J 6 import javax.swing.*; 2 import java.awt.*; 3 public class Exam extends JFrame { 5 JRadioButton rbl = new JRadioButto

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

J 6 import javax.swing.*; 2 import java.awt.*; 3 public class Exam extends JFrame { 5 JRadioButton rbl = new JRadioButto

Post by answerhappygod »

J 6 Import Javax Swing 2 Import Java Awt 3 Public Class Exam Extends Jframe 5 Jradiobutton Rbl New Jradiobutto 1
J 6 Import Javax Swing 2 Import Java Awt 3 Public Class Exam Extends Jframe 5 Jradiobutton Rbl New Jradiobutto 1 (237.35 KiB) Viewed 48 times
J 6 import javax.swing.*; 2 import java.awt.*; 3 public class Exam extends JFrame { 5 JRadioButton rbl = new JRadioButton ("Avada Kedavra"); JRadioButton rb2 = new JRadioButton ("Expelliarmus"); JRadioButton rb3 = new JRadioButton ("Lumos"); 8 JRadioButton rb4 - new JRadioButton ("Ridikulus"); 9 JPanel pl = new JPanel(); 10 JPanel p2 = new JPanel(); 11 JPanel p3 = new JPanel(); 12 JButton b = new JButton ("Submit"); 13 JLabel 11 = new JLabel("What spell would you use 14 + "to light the tip of your wand?"); 15 Font font = new Font ("Verdana", Font.PLAIN, 18); 16 Exam (String t) { 17 super (t); 18 set Layout (new GridLayout(3,1)); 19 pl.setBackground (Color.black); 20 p2.setBackground (Color.white); 21 pl.setLayout (new Border Layout()); 22 p2.setLayout (new GridLayout(2,2)); 23 11. setFont (font); 24 11. setForeground (Color.white); 25 rbl. setFont (font); 26 rb2. setFont (font); 27 rb3. setFont (font); 28 rb4. setFont (font); 29 rbl.setBackground (Color.white); 30 rb2.setBackground (Color.white); rb3.setBackground (Color.white); 32 rb4.setBackground (Color.white); 33 pl.add(11); 34 p2.add (rbl); 35 p2.add (rb2); 36 1/p2.add (rb3); 37 p2.add (rb4); 38 p3.add(b); 39 add (pl); 40 add (p2); 41 add (p3); 42 this.setSize (700,300); 43 this.setVisible(true); 44 this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) 45 } 46 public static void main(String[] args) { 47 new Exam ("Hogwarts Entrance Exam"); 48 } 49 ) о со о л о Ο Α Ο Ο Ο Ο Ο Ο Ο Ο Ο Ο ΟΗΕΕΕΕΕΕΕΕΕ л woo co Jo un co o o o co Jo un co Jно 31 DO

1.1 Name all GUI instances that are instantiated from subclasses of JComponent (Your scores will be deducted for incorrect answers.) (2 points) 1.2 At which line an instance of the class Exam is created? (1 point) 1.3 What type of container is the Exam object? (1 point) 1.4 How many containers (including sub-containers) are there in the class Exam? Name all container instances. (2 points) 1.5 What is the layout manager of each container? (2 points) 1.6 Sketch the panel p2 with GUI components added to it when the program is executed. (1 point) 1.7 Sketch the panel p2 with GUI components added to it when the statement at line 36 is uncommented and the program is executed. (1 point)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply