java graphics interface

Solutions on MaxInterview for java graphics interface by the best coders in the world

showing results for - "java graphics interface"
Eleonora
02 Feb 2016
1import javax.swing.*;
2class gui{
3    public static void main(String args[]){
4       JFrame frame = new JFrame("My First GUI");
5       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
6       frame.setSize(300,300);
7       JButton button = new JButton("Press");
8       frame.getContentPane().add(button); // Adds Button to content pane of frame
9       frame.setVisible(true);
10    }
11}
12