Results 1 to 9 of 9
Thread: CMD Prompt Equivelants to a GUI
- 05-11-2012, 01:26 AM #1
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
- 05-11-2012, 01:31 AM #2
Senior Member
- Join Date
- Jun 2007
- Location
- Bali, Indonesia
- Posts
- 696
- Rep Power
- 6
Re: CMD Prompt Equivelants to a GUI
In GUI such as Swing you can use something like JLabel, JTextField, JTextArea, etc. It depends on how you design your GUI and the Swing components that you want to use.
Website: Learn Java by Examples
- 05-11-2012, 03:03 AM #3
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: CMD Prompt Equivelants to a GUI
So what you are saying is that this:
Would produce the same output as this:Java Code:System.out.print("This is the same");
Java Code:JOptionPane.showMessageDialog(null, "This is the same");
- 05-11-2012, 03:21 AM #4
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: CMD Prompt Equivelants to a GUI
I am guessing not...because I switched all of the lines in my code to mirror the changes below, and it is still printing in a cmd window even tho there is NO code that says to print in a command window!!!???
-
Re: CMD Prompt Equivelants to a GUI
- 05-11-2012, 03:37 AM #6
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: CMD Prompt Equivelants to a GUI
Java Code:public static void main(String args[]){ int n,i,j,k; String rowcountNum; int rowcount; rowcountNum = JOptionPane.showInputDialog("Enter Number Please"); //convert numbers from String to type in rowcount = Integer.parseInt(rowcountNum); n=rowcount; //System.out.println(n); JOptionPane.showMessageDialog(null, n); //System.out.println(); JOptionPane.showMessageDialog(); for (i = 1; i <= n/2; i++){ for (k = n; k > i; k--) JOptionPane.showMessageDialog(null, " "); //System.out.print(" "); for (j =1; j <= i; j++) JOptionPane.showMessageDialog(null, "*" + " "); //System.out.print("*" + " "); JOptionPane.showMessageDialog(); //System.out.println(); } for (i = (n/2)+1; i > 0; i--){ for (k = n; k > i; k--) JOptionPane.showMessageDialog(null, " "); //System.out.print(" "); for (j =1; j <= i; j++) JOptionPane.showMessageDialog(null, "*" + " "); //System.out.print("*" + " "); JOptionPane.showMessageDialog(); //System.out.println(); } } }
-
Re: CMD Prompt Equivelants to a GUI
When I run this code, nothing prints in my console.
- 05-11-2012, 04:03 AM #8
Member
- Join Date
- Apr 2012
- Posts
- 88
- Rep Power
- 0
Re: CMD Prompt Equivelants to a GUI
Well it would def help if I was running the .java file where I made these changes! Sorry for wasting your time.
-
Similar Threads
-
New Command prompt
By jmga9 in forum New To JavaReplies: 4Last Post: 11-10-2010, 01:53 AM -
How to cause a second prompt to run after the first.
By G-Unit in forum New To JavaReplies: 4Last Post: 03-25-2010, 04:47 PM -
Jcreator to DOS Prompt
By arshesander in forum New To JavaReplies: 5Last Post: 02-17-2010, 06:25 AM -
help me!!!! about command prompt..
By kureikougaiji in forum New To JavaReplies: 2Last Post: 11-13-2008, 06:15 PM -
input prompt
By angelbaby21 in forum New To JavaReplies: 8Last Post: 08-25-2008, 04:22 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks