Suppose we have created a class called MyGUI, which represents a GUI. Write a program that creates a JFrame object, adds a MyGUI object to the frame and makes it visible.
What will be an ideal response?
```
import javax.swing.*;
public class MyGUIDisplayer {
public static void main(String [] args) {
JFrame frame = new Jframe("My GUI");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(new MyGUI());
frame.pack();
frame.setVisible(true);
} // end main
} // end class MyGUIDisplayer
```
Computer Science & Information Technology
You might also like to view...
Unless the user specifies otherwise, options set in the Page Setup dialog box are applied to the current:
A) paragraph. B) page. C) section. D) document.
Computer Science & Information Technology
A(n) ______ allows two modules to communicate with each other.
a. data structure b. axiom c. interface d. client
Computer Science & Information Technology