Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Window.java// import javax.swing.*; class Window extends JFrame { JPanel pnl = new JPanel(); public static void main(String[]args) { Window gui = new Window() ; }

Window.java//

import javax.swing.*;

class Window extends JFrame { JPanel pnl = new JPanel(); public static void main(String[]args) { Window gui = new Window() ; } public Window() { super("Swing Window"); setSize(500,200); setDefaultCloseOperation(EXIT_ON_CLOSE); add(pnl); setVisible(true); } }

image text in transcribed

image text in transcribed

image text in transcribed

1 Edit a copy of Window.java from page class name in the declaration, the constructor, and the instance statement from "Window" to "Labels" 135, changing the 2 Before the Labels0 constructor, create an Imagelcon object Imagelcon duke new Imagelcon( duke.png" ) ; 3 Next create three JLabel objects to display an image, text, and both text and an image re Label ibl1 = new JLabel( duke ) ; JLabel lb12 = new JLabel( Duke is the friendly mascot of Java technology.") Label ibl3 = new JLabel( "Duke'. , duke , JLabel.CENTER ) ; 4 Inside the Labels0 constructor insert this statement to create a ToolTip for the first label Ibl1.setToolTipText "Duke the Java Mascot" ) 5 align the text centrally be Add these two statements to the third label Ibl3.setHorizontalText Position( JLabel.CENTER) Ibl3.setVerticalTextPosition( JLabel.BOTTOM) low

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

More Books

Students also viewed these Databases questions

Question

Make efficient use of your practice time?

Answered: 1 week ago