who can help me with GUI??

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2006
Posts: 1
Reputation: c_est_la_vie is an unknown quantity at this point 
Solved Threads: 0
c_est_la_vie c_est_la_vie is offline Offline
Newbie Poster

who can help me with GUI??

 
0
  #1
Apr 6th, 2006
already done the TIO one as follows:
do
{ dStr=JOptionPane.showInputDialog("Please enter "+name+"'s demand:");
d=console.nextInt();
if (d<0)
System.out.println("Demand can't be negative.");
}while(d<0);

but don't know how to transfer it into GUI style?
anyone can help me? Thx!!!!
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: who can help me with GUI??

 
0
  #2
Apr 6th, 2006
Originally Posted by c_est_la_vie
already done the TIO one as follows:
do
{ dStr=JOptionPane.showInputDialog("Please enter "+name+"'s demand:");
d=console.nextInt();
if (d<0)
System.out.println("Demand can't be negative.");
}while(d<0);

but don't know how to transfer it into GUI style?
anyone can help me? Thx!!!!
Get a good book which shows you how to do the basics of creating and listening to user input with GUI's.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 573
Reputation: Dark_Omen is an unknown quantity at this point 
Solved Threads: 5
Dark_Omen Dark_Omen is offline Offline
Posting Pro

Re: who can help me with GUI??

 
0
  #3
Apr 7th, 2006
What are you trying to do exactly. Are you doing a console app with JOption pane that will write to the console or do you want it to show up on like a GUI?, both are pretty simple. If you are just writing it to console then System.out.print(); will work. If you want to print it to a GUI, you will nees a label, JLabel label = new JLabel(), then set the text of the label to the input you recieved, which I think is a method called setText, so label.setText(inputHere); and I am not sure but I think you might have to repaint.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC