PDA

Click to See Complete Forum and Search --> : Providing application skins for java applications


debbie_82
Apr 13th, 2004, 07:54 PM
How do I go about specifying my own skin for my components (like I will specify it's own look and feel)...
It's got to do with graphics isn't it... I really don't know what to do
just yet...can anyone help me... What is the difference between Graphics2D and Graphics Class in Java...? And what is double buffering? Anybody pls help.

Dillinger4
Apr 19th, 2004, 12:07 PM
Is this what you are looking for? Note that to update a component once is has already been created the updateUI() method from JComponent can be used. To update the whole GUI after changing the look and feel use the static method updateComponentTreeUI() from the SwingUtilities class.

try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}(Exception e){
System.out.println("Could not use the native platform look and feel: " + e);
}

Dillinger4
Apr 19th, 2004, 12:15 PM
Sorry i forgot about the other questions. :blush: Double Buffering is just used to speed up the process of rendering the components. The updating of any components is done in an off-screen buffer then once all the rendering is done they are copied to the screen. You can turn Double Buffering off by using void setDoubleBuffered(boolean flag). You can also check to see if a component is buffered by calling boolen isDoubleBuffered()

CornedBee
Apr 19th, 2004, 01:31 PM
Graphics2D is a class that provides added abilities for drawing, especially 2D transformations. The Graphics object that is passed to paint is always a Graphics2D in Java 1.2 upwards (I think, maybe 1.3).

debbie_82
May 19th, 2004, 12:59 AM
Originally posted by CornedBee
Graphics2D is a class that provides added abilities for drawing, especially 2D transformations. The Graphics object that is passed to paint is always a Graphics2D in Java 1.2 upwards (I think, maybe 1.3).

Is using Graphics 2D classes make the program slower?

The one I made was very slow... I wonder if its due to the graphics... I haven't added any functionalities yet because it's the gui part of the program.. I'm wondering what could be making this one really slow.

Here is my project which I made using JBuilder. Also there is some problem with painting of some components...

I'm a newbie in java and I'm not quite sure why this program is really slow... Even using P4 processor 1.8ghz and 512mb memory it's still slow.. In my computer its 256mb...

Please any help is greatly appreciated.