• 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

Creating a GUI from text based program

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For my java class i have to create a GUI that will calculate the final price of a purchase item using values entered by the user. I have already wrote the program and it works perfectly, but it is text based right now and I suck at creating GUI's. Here is what I have so far...



PurchaseReduxPanel



it's a bit messy and i apologize in advance for it.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You had any particular question in mind?
If you are wondering in general, how to write your own UI, check out http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html

This would be better suited on the UI forums.
Moving....
 
mike korb
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:You had any particular question in mind?
If you are wondering in general, how to write your own UI, check out http://docs.oracle.com/javase/tutorial/uiswing/components/frame.html

This would be better suited on the UI forums.
Moving....




Okay, I got the program to compile through TrafficLightPanel, but I can't get it to compile through my TrafficLight mainframe can someone please help? Here is what I have so far.



TrafficLightPanel
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
both have main()
both extend JFrame

you can't add a window/frame to another window/frame:
frame.getContentPane().add(new TrafficLightPanel());
reply
    Bookmark Topic Watch Topic
  • New Topic