wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Converting this program into GUI? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Converting this program into GUI?" Watch "Converting this program into GUI?" New topic
Author

Converting this program into GUI?

Price Peddicord
Greenhorn

Joined: Dec 03, 2012
Posts: 6
Okay so im not completely done with this program, but i want to get it working in GUI and then applet before i move on in it, its a grading program that then spits out grades needed for an A for now, whats the easiest way to convert this into GUI, ive really only used joptionpane and not really all that much looking for any and all help maybe if someone could convert one section of it for me would be amazing as well where i could look at it for how to do the rest!
And for example the last part from "For an A in this class you will need the following grades: through all of the assignments id like all of that on one panel! Ive got this program to work but gah am i horrible at GUI

Thanks!

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
Welcome to the Ranch
You need to consider what the public interface of your application is.

So I looked for a public interface … And it hasn’t got one. It is only a main method, so it isn’t a Java application at all. It is simply a procedure.
I am afraid you are going to have to start from scratch if you want to make that into an application.
Can you run it from a main method in another class? Can you put values in and get things back? Can you write this sort of thing?When you write that sort of thing and have it working on the command line, then you have an interface which you can put your GUI on top of.
Price Peddicord
Greenhorn

Joined: Dec 03, 2012
Posts: 6
Campbell Ritchie wrote:Welcome to the Ranch
You need to consider what the public interface of your application is.

So I looked for a public interface … And it hasn’t got one. It is only a main method, so it isn’t a Java application at all. It is simply a procedure.
I am afraid you are going to have to start from scratch if you want to make that into an application.
Can you run it from a main method in another class? Can you put values in and get things back? Can you write this sort of thing?When you write that sort of thing and have it working on the command line, then you have an interface which you can put your GUI on top of.



Start from scratch O.o lol been working on this for the last few days and its for something due tommorow haha this doenst sound good, i mean it all works in the command line?? and i had it spitting back values after i input things to ensure it was setting the arrays right!

And we have gone over a bit of code like that but i couldnt even begin to write that without a huge reference to look at haha

Thank you for the welcome!! Hopefully if i make it out of this java1 class (finals week this week) ill be around on here for java2 next semester lol course i need to make it through this program first
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
If you are going to hand it in, it needs some tidying up. Sorting out these things will earn marks:-
Your indentation is inconsistent, and you should use spaces, not tabs. Also you have too many blank lines, which do not improve legibility. When you break a line because of its length (which you have noticed correctly), indent the continuation part more than its start. Example here. But don’t believe them about eight spaces.
If you break String literals into two lines, you must use the + operator to join them together: " at the end of the line and " at the start of the next line and a + in between.
Get rid of those floats. You should use doubles.
You have got lots of local variables. Chances are you do not actually need all eleven of them. You are also inconsistent about whether you initialise the variables to 0. I have not looked to see which actually need to be zeroed.
Always populate an array with a for loop. Not a do loop. Nor a for-each loop which doesn’t actually fill the array.
 
Don't get me started about those stupid light bulbs.
 
subject: Converting this program into GUI?
 
Similar Threads
Noob java assigment
A little stumped on how to approach next step of my program!
Powerball program for school, Need to to run program 8 times.
Netbeans and Ctrl + z (end of file)
need help: I'm just not getting how this whole "private" / "public" class definition thing works.