Results 1 to 3 of 3

Thread: JOptionPane

  1. #1
    whosadork is offline Member
    Join Date
    Sep 2008
    Posts
    29
    Rep Power
    0

    Default JOptionPane

    How do i make all the different JPanel Boxes on the same box?

    Java Code:
    import javax.swing.JOptionPane;
    
    public class AstroEmpiresCalculator 
    {
    	public static void main( String args[] )
    	{
    		int Fighters = 0;
    		int Bombers = 0;
    		int HeavyBombers = 0;
    		
    		JOptionPane.showInputDialog( "Fighters",Fighters );
    		JOptionPane.showInputDialog( "Bombers",Bombers );
    		JOptionPane.showInputDialog( "Heavy Bombers",HeavyBombers );
    		
    	}
    }

  2. #2
    Eku
    Eku is offline Senior Member
    Join Date
    May 2008
    Location
    Makati, Philippines
    Posts
    234
    Rep Power
    7

    Default

    all in same box?

    you can always try to create another container (with all those inputs in it) rather than using multiple Input dialog.
    Mind only knows what lies near the heart, it alone sees the depth of the soul.

  3. #3
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    Java Code:
            String s = "<html>Fighters: " + Fighters + "<br>" +
                       "Bombers: " + Bombers + "<br>" +
                       "Heavy Bombers: " + HeavyBombers;
            JOptionPane.showMessageDialog(null, s);

Similar Threads

  1. JOptionPane
    By Mir in forum New To Java
    Replies: 5
    Last Post: 11-29-2008, 02:04 AM
  2. JOptionPane problem
    By MomenT in forum New To Java
    Replies: 22
    Last Post: 10-02-2008, 05:56 PM
  3. About JOptionPane.showMessageDialog
    By jhetfield18 in forum AWT / Swing
    Replies: 2
    Last Post: 11-02-2007, 10:45 PM
  4. About JOptionPane.showMessageDialog
    By jhetfield18 in forum Advanced Java
    Replies: 0
    Last Post: 11-02-2007, 10:56 AM
  5. problems with JOptionPane
    By oregon in forum AWT / Swing
    Replies: 2
    Last Post: 08-05-2007, 05:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •