











































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












































import javax.swing.*;
...
JOptionPane.showMessageDialog( null, “I Love Java” );
import javax.swing.*;
...
String inputstr =
JOptionPane.showInputDialog( null, “What is your name?” );
import javax.swing.*;
class DefaultJFrame {
public static void main( String[] args ) { JFrame defaultJFrame; defaultJFrame = new JFrame(); defaultJFrame.setVisible(true); }
}
This gray area is the content pane of this frame.
Container contentPane = getContentPane(); contentPane.setBackground(Color.BLUE);
contentPane.setLayout( new FlowLayout()); okButton = new JButton("OK"); cancelButton = new JButton("CANCEL"); contentPane.add(okButton); contentPane.add(cancelButton);