Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Popout Jframe, Everything is STACKING!!! Help!

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Popout Jframe, Everything is STACKING!!! Help!

    Problem.jpg

    There all Stacking?
    Can someone Help Me Fix This?



    Notice: This Program is to practice coding/challenge.


  2. #2
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: Popout Jframe, Everything is STACKING!!! Help!

            gen = new JButton("Generate");
            add(gen);
            gen.addActionListener(new ActionListener() {
     
                public void actionPerformed(ActionEvent e)
                {
    				JFrame options = new JFrame("UGC Code");
    				options.setVisible(true);
    				options.setSize(200,200);
     
            	    Random randomGenerator = new Random();
            	    for (int idx = 1; idx <= 1; ++idx){
            	      int randomInt = randomGenerator.nextInt(999);
     
            		test = new JLabel(""+randomInt+"");
            		options.add(test);
     
            	    Random randomGenerator2 = new Random();
            	    for (int idx2 = 1; idx2 <= 1; ++idx2){
            	      int randomInt2 = randomGenerator2.nextInt(999);
     
            		test3 = new JLabel(""+randomInt2+"");
            		options.add(test3);
     
            	    Random randomGenerator3 = new Random();
            	    for (int idx3 = 1; idx3 <= 1; ++idx3){
            	      int randomInt3 = randomGenerator3.nextInt(9999);
     
            		test2 = new JLabel(""+randomInt3+"");
            		options.add(test2);

Similar Threads

  1. using objects from one jFrame on a different jFrame
    By Taskeen in forum AWT / Java Swing
    Replies: 3
    Last Post: September 14th, 2011, 08:51 AM
  2. connecting jframe to another jframe
    By ajtambalo in forum Member Introductions
    Replies: 2
    Last Post: May 11th, 2011, 11:24 AM
  3. Pop-out box using a JFrame.
    By ShaunB in forum Java Theory & Questions
    Replies: 6
    Last Post: April 28th, 2011, 12:03 PM
  4. JFrame
    By M3ss1ah in forum AWT / Java Swing
    Replies: 3
    Last Post: February 23rd, 2011, 05:00 PM
  5. JFrame help
    By Uden in forum AWT / Java Swing
    Replies: 0
    Last Post: August 14th, 2009, 01:37 PM