extends JFrame

The JFrame is a class like any other and can be extended. Program       Program Source import javax.swing.JFrame; class Frame extends JFrame{ Frame() { setTitle(“First java GUI application”); setSize(700, 200); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } public class Javaapp { public static void main(String[] args) { Frame frame = new Frame(); } }


Swing The Swing package in Java enables the programmers to create Graphical User Interface applications. It contains a number of classes that help to implement Windows-based tasks, such as manipulating windows, adding scroll bars, buttons, list items, text boxes, etc. All the classes are contained in the javax.swing package. These classes are hierarchically arranged inside … Read more…