- 4 Fill In The Blanks So That This Program Displays A Frame Import Java Awt Public Class Microgui Public Static Void 1 (33.03 KiB) Viewed 34 times
4. Fill in the blanks so that this program displays a Frame: import java.awt." public class microGUI{ public static void
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4. Fill in the blanks so that this program displays a Frame: import java.awt." public class microGUI{ public static void
4. Fill in the blanks so that this program displays a Frame: import java.awt." public class microGUI{ public static void main(String all I JFrame frm= new _( 150, 100); frm true); 1) frm a. Panel,setSize, paint b. Frame, setVisible, setSite crm, setVisible, seton dJFrame, setSize, setVisible 5. The following code should produce the output in Fig. 1. Something went wrong. Modify the code to show the display in Fig. 2. package package import java.awt." import javax.swing." public class Swing Test public static void main(String[] args) JFrame frame = new JFrame("Test Frame"); frame.setDefaultCloseOperation Frame.EXIT_ON_CLOSE); frame.pack: frame.setSize(new Dimension[300,2001): frame.setLocation, 0); frame.setLocation(250, 250): Container contentPane = frame gerContentPanel: frame.setVisible(false): contentPane.setBackgroundColor.red): frame.setLayout(new Border Layout(). frame.add(new JButton("Click"). BorderLayout SOUTH frame.add(new JButton("Do not Click), BorderLayout. NORTH): } Fig. 1 Fie 2