Look and Feel

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Marko

Look and Feel

Post by Marko » Tue Jun 25, 2002 10:50 am

Hi all,

I just changed the look and feel of my applet from Windows to Java (cross platform). All containers & components change their "look and feel" accordingly, except of the chart. Is this kind of functionality missing, or am I doing something wrong? Thanks a lot!

Cheers,

Marko

PS: David, keep up the good work!

David Gilbert

Re: Look and Feel

Post by David Gilbert » Tue Jun 25, 2002 11:37 am

What things in particular? There's not a lot to change except perhaps the popup menu on the ChartPanel, or the border if you've added one. I'm not entirely sure what is required to make a look and feel change happen, but I'm happy to update the code if someone provides some pointers...

Regards,

DG.

Pawel Bogaczewicz

Re: Look and Feel

Post by Pawel Bogaczewicz » Tue Jun 25, 2002 12:11 pm

hmmm..chart is just an image. what should look fdifferent in various lafs?

maybe You can post Your code and say what You'd expected to happened?

Marko

Re: Look and Feel

Post by Marko » Tue Jun 25, 2002 2:50 pm

Hi again,

ok, I was not really precise... All my other panels change their color to light grey (among some other changes like different looking scrollbars etc.), but the chart panel still has the same darkgray as in the Windows Look and Feel. I know that the color can be changed individually, but wouldn't it be nice if it would change automatically?! Unfortunately I don't know myself where to add the according piece of code.

Thanks!

Cheers,

Marko

David Gilbert

Re: Look and Feel

Post by David Gilbert » Tue Jun 25, 2002 11:49 pm

The chart background defaults to Color.lightGray. This doesn't always match the shade used in a particular user interface. There is probably a way to detect the look and feel change in the ChartPanel and try to update the chart background color accordingly...if someone wants to contribute code to do this, I'll add it in.

Regards,

DG.

MartinSmith

Re: Look and Feel

Post by MartinSmith » Wed Jun 26, 2002 4:48 pm

I believe the only thing you would need to do would be to set the default color to

SystemColor.control

instead of an actual color. This will also handle the situation where the user changes the colour scheme in Windows or motif etc.


Martin Smith

Locked