BorderWindow.java - import javax.swing\/Needed for Swing classes import java.awt\/Needed for BorderLayout class public class BorderWindow extends JFrame

BorderWindow.java - import javax.swing/Needed for Swing...

This preview shows page 1 out of 1 page.

import javax.swing.*; //Needed for Swing classes import java.awt.*; //Needed for BorderLayout class public class BorderWindow extends JFrame { /** This class demonstrates BorderLayout manager. */ private final int WINDOW_WIDTH = 400; private final int WINDOW_HEIGHT = 300; public BorderWindow() //Constructor { //Set the title bar text setTitle("Border Layout"); //Set the size of the window setSize(WINDOW_WIDTH, WINDOW_HEIGHT); //Specify an action for the close button setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //Add a BorderLayout manager to the content pane setLayout(new BorderLayout()); //Create five buttons JButton button1 = new JButton("North Button");

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture