Professional Documents
Culture Documents
1.Java JDesktopPane:
The JDesktopPane class, can be used to create "multi-document" applications. A multi-
document application can have many windows included in it. We do it by making the
contentPane in the main window as an instance of the JDesktopPane class or a subclass.
Internal windows add instances of JInternalFrame to the JdesktopPane instance. The
internal windows are the instances of JInternalFrame or its subclasses.
Fields
Constructor
EXERCISE Questions:
// frame
static JFrame f;
// main class
public static void main(String[] args)
{
// create a new frame to
f = new JFrame("frame");
// create a Button
JButton b = new JButton("button");
// create a panel
JPanel p = new JPanel();
f.show();
}
}
Q#3: program to create multiple internal frames
// frame
static JFrame f;
// main class
public static void main(String[] args)
{
// create a new frame
f = new JFrame("frame");
// create a Button
JButton b = new JButton("button");
JButton b1 = new JButton("button1");
// create a panel
JPanel p = new JPanel();
JPanel p1 = new JPanel();
f.show();
}
}
Q#4 Program to create multiple frame and set icon to the frame
// java Program to create multiple frame and set icon to the frame
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
class solution extends JFrame {
// frame
static JFrame f;
// main class
public static void main(String[] args)
{
// create a new frame
f = new JFrame("frame");
// create a Button
JButton b = new JButton("button");
JButton b1 = new JButton("button1");
// create a panel
JPanel p = new JPanel();
JPanel p1 = new JPanel();
f.show();
}
}