• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GUI

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am learning JAVA and I am trying to create a GUI. I want to run the below mentioned program. Please help me.... what should i pass to the new object created of the class in its static method.Thanks in Advance for your help.

[ November 23, 2008: Message edited by: david john ]
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first thing that you should do is to study Sun Swing tutorial as it is the best single way I know of learning how to code Swing. There you will learn good Swing-habits from the get go. There you will learn that JComponents must be placed within a root container of some sort (either directly or indirectly by placing in another JComponent that is in a hierarchy that leads to a root container).

One way to show your class would be to add it to a JFrame like so:



Oops, one last thing. Do you know that there is a Swing forum here where all Swing questions should go. Reason being, you'll have a much better chance of running into a true Swing guru in that forum. Here you'll be stuck with folks like me. So while I'd leave this discussion in this current thread, if you have future Swing questions, do give the Swing forum a look.
[ November 23, 2008: Message edited by: pete stein ]
 
david john
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pete, Thanks a lot!
I will try to learn more about Swing...
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably best to move this thread to the Swing forum.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Thread hijack removed. And please do not post the same question in more than one place.]
[ November 30, 2008: Message edited by: Bear Bibeault ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic