Results 1 to 3 of 3
  1. #1
    Ak-Emm is offline Member
    Join Date
    Aug 2008
    Posts
    17
    Rep Power
    0

    Question Help needed NetBeans

    I have a deadline to meet and urgent this Saturday

    I need your help with connectors

    How to call a J-frame from a main frame in java when a button is clicked in Netbeans

    I have two frames (A) and [B]

    Frame (A) is the main and the other [B] is a sub-frame

    in the main frame (A) theres a button to click it should open the sub-frame (frame [B] what should i do to achieve this in NetBeans ?




    and the Second problem encountered is how to create a Menu-Bar in NetBean i Know how to use the panel but where does the coding fit?

    Thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    I have a deadline to meet and urgent this Saturday
    You probably don't want to state this in your posts. Even if it is urgent to you, realize that it is not urgent to us. Many here take offense to this as it implies to them that a) the poster thinks that his post is more important than everyone else's, and b) that the poster wants to put pressure on the volunteers who come here to help on their own free time. Just a friendly word of advice.

    I need your help with connectors
    How to call a J-frame from a main frame in java when a button is clicked in Netbeans
    Likely this is a Swing Java issue and probably has little to do with NetBeans unless you are talking about NetBeans-generated code.

    I have two frames (A) and [b]
    Are "frames" JFrames?

    Frame (A) is the main and the other [b] is a sub-frame
    in the main frame (A) theres a button to click it should open the sub-frame (frame [b] what should i do to achieve this in NetBeans ?
    You will have to add an ActionListener to the JButton, and in this ActionListener create a FrameB object, call its constructor, call pack(); on this object (if not done in the constructor), and call setVisible(true) on this object. For more details, see the Sun Swing tutorials.

    and the Second problem encountered is how to create a Menu-Bar in NetBean i Know how to use the panel but where does the coding fit?
    Check out the Sun tutorials on Menus.

    Good luck.

  3. #3
    Ak-Emm is offline Member
    Join Date
    Aug 2008
    Posts
    17
    Rep Power
    0

    Default

    J-frames sorry

    thanks
    so i add the action listener to the button
    in the source i type call pack(); set visible true

    what should i label in call pacK(); the sub frame B?
    Last edited by Ak-Emm; 08-21-2008 at 05:17 PM.

Similar Threads

  1. help needed!!! :S
    By mark-mlt in forum Networking
    Replies: 1
    Last Post: 04-14-2008, 09:27 AM
  2. Help needed.
    By necro-1000 in forum AWT / Swing
    Replies: 2
    Last Post: 01-12-2008, 11:37 AM
  3. Help Needed
    By pks in forum New To Java
    Replies: 1
    Last Post: 01-09-2008, 12:07 AM
  4. help needed.
    By dirtycash in forum New To Java
    Replies: 3
    Last Post: 12-03-2007, 09:17 PM
  5. jfreeReport help needed
    By sandor in forum XML
    Replies: 1
    Last Post: 04-20-2007, 08:10 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
  •