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.
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.
Code:
try{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}(Exception e){
System.out.println("Could not use the native platform look and feel: " + e);
}
Sorry i forgot about the other questions. 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()
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).
All the buzzt CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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...