▪▪Graphics P2.16 Run the following program: import java.awt.Color; import javax.swing.JFrame; import javax.swing.JLabel;

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: 899603
Joined: Mon Aug 02, 2021 8:13 am

▪▪Graphics P2.16 Run the following program: import java.awt.Color; import javax.swing.JFrame; import javax.swing.JLabel;

Post by answerhappygod »

Graphics P2 16 Run The Following Program Import Java Awt Color Import Javax Swing Jframe Import Javax Swing Jlabel 1
Graphics P2 16 Run The Following Program Import Java Awt Color Import Javax Swing Jframe Import Javax Swing Jlabel 1 (34.05 KiB) Viewed 13 times
▪▪Graphics P2.16 Run the following program: import java.awt.Color; import javax.swing.JFrame; import javax.swing.JLabel; public class FrameViewer { public static void main(String[] args) ( JFrame frame = new JFrame(); frame.setSize(200, 200); JLabel label= new JLabel("Hello, World!"); label.setOpaque (true); label.setBackground (Color. PINK); frame.add(label); frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } Modify the program as follows: • Double the frame size. • Change the greeting to "Hello, your name!". Change the background color to pale green (see Exercise Graphics E2.11). • For extra credit, add an image of yourself. (Hint: Construct an ImageIcon.)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply