• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Swing - Problem in LookAndFeel

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
}
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic