It's not a secret anymore!*
The moose likes Swing / AWT / SWT and the fly likes Creating a GUI from text based program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Creating a GUI from text based program" Watch "Creating a GUI from text based program" New topic
Author

Creating a GUI from text based program

mike korb
Greenhorn

Joined: Nov 11, 2012
Posts: 4
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.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

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....


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
mike korb
Greenhorn

Joined: Nov 11, 2012
Posts: 4
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
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
both have main()
both extend JFrame

you can't add a window/frame to another window/frame:
frame.getContentPane().add(new TrafficLightPanel());
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating a GUI from text based program