Sunday, September 28, 2014

How to Connect Frames Using NetBeans

Instructions

    1

    Open NetBeans and the Java project you want to edit, then double-click the file for the first frame you want to use to link to another frame.

    2

    Create the second frame by adding the following code:

    JFrame frame2 = new JFrame("My Frame");

    Change the "My Frame" text to your own title for the frame.

    3

    Open the frame and set its visibility status so it displays on the user's desktop. The following code links and opens the second frame:

    frame2.setVisible(true);

    4

    Save the frame code changes and click NetBeans' "Run" button to execute the code in the debugger.



No comments:

Post a Comment