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 4 of 4

Thread: problem developing a frame help me...

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default problem developing a frame help me...

    import java.awt.*;
    import javax.swing.*;

    public class BorderExample {
    private JFrame f;
    private JButton bn, bs, bw, be, bc;

    public BorderExample() {
    f = new JFrame ("Border Layout");
    bn = new JButton ("Button 1");
    bs = new JButton ("Button 2");
    bw = new JButton ("Button 3");
    be = new JButton ("Button 4");
    bc = new JButton ("Button 5");
    }
    public void launchFrame () {
    f.add(bn, BorderLayout.NORTH);
    f.add(bs, BorderLayout.SOUTH);
    f.add(bw, BorderLayout.WEST);
    f.add(be, BorderLayout.EAST);
    f.add(bc, BorderLayout.CENTER);
    f.setSize(400,200);
    f.setVisible(true);
    }
    public static void main (String args []) {
    BorderExample guiWindow2 = new BorderExample();
    guiWindow2.launchFrame();
    }
    }


    I am trying to run this program in the cmd but it always opens a new window with the same above program in it....i am not getting the desired output.


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: problem developing a frame help me...

    What commands are you using to compile and run the program?

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: problem developing a frame help me...

    Quote Originally Posted by pbrockway2 View Post
    What commands are you using to compile and run the program?
    javac BorderExample.java

    And the program remains stable nothing happens to it.
    Its the same when every program is perfect.Incase it is not then it shows error but when i correct the error no output is shown.

  4. #4
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: problem developing a frame help me...

    And what about running the program?

Similar Threads

  1. Best Tools for developing in Java/Android
    By Nesh108 in forum Android Development
    Replies: 11
    Last Post: October 24th, 2012, 07:34 AM
  2. Replies: 1
    Last Post: January 19th, 2012, 03:44 PM
  3. problem displaying a new frame
    By yemista in forum AWT / Java Swing
    Replies: 0
    Last Post: October 18th, 2011, 02:08 PM
  4. Need help in developing a clock application
    By sb.shiv in forum AWT / Java Swing
    Replies: 2
    Last Post: August 24th, 2010, 02:00 AM
  5. How to develop plugins in Netbeans?
    By haygaurav in forum Web Frameworks
    Replies: 1
    Last Post: May 27th, 2009, 04:49 PM