4. Fill in the blanks so that this program displays a Frame: import java.awt." public class microGUI{ public static void
Posted: Fri May 20, 2022 1:29 pm
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