Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing - Problem in LookAndFeel  RSS feed

 
Niyas Ahmed Sheikh
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below is not compiling. I copied this prgoram from Sun's tutorial.
The Error due to this line: JFrame.setDefaultLookAndFeelDecorated(true);



Error Message:


1. What is event-dispatching thread.

2. If we want to use thread, we have extend Thread or implement Runnable. But in this program nothing is used. Why?

3. What is the meaning of the below coding:
javax.swing.SwingUtilities.invokeLater(new Runnable()

4. I heard that swing is platform independent. That is it's look and feel will be same across all the platform. Is it true? If so, I am getting the maximize amd minimize button(Windows Look and Feel) is differ from the one I seen in the Sun's tutorial output(Java Look and Feel). Why?

[ September 09, 2005: Message edited by: Niyas Ahmed Sheikh ]
[ September 09, 2005: Message edited by: Niyas Ahmed Sheikh ]
 
Khan Malamir
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About the compile problem - this method is since JDK 1.4, do you use an older version?

1 and 3 are better answered by Sun in Threads and Swing

I don't understand your question (2), you have a Runnable implementation that is queued on the vent thread.

4 is probably because default LAF differs on different platforms.
 
Carty Ellis
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This works fine for me

public static void main(String[] args) {
/*
* The following "try" sets the look and feel of the system the
* application is running on
*/
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (NoClassDefFoundError e) {
System.out.println("UIManager error:" + e.getMessage());
} catch (Exception e) {
System.out.println("MESSAGE:" + e.getMessage());
}

RunConversionLoad gui = new RunConversionLoad();
gui.go();
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!