Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

JFrame

ATE16
ATE16 


Create an application with a JFrame and at least five labels that contain interesting historical facts. Every time the user clicks a JButton, remove one of the labels and add a different one. Save the file as JHistoricalFacts.java. Have the program include the following: -Create an interactive program that meets the above requirements -Create a JFrame and add the setDefaultCloseOperation method -Create a Button and Labels -Implement ActionListener. -Overide the ActionPerformed method. -Use the FLowLayout Manager Attachments
Tags Clarifications

Answers

program

sudheer488
sudheer488 



hi instead of mentioning historical facts i have mentioned a,b,c,d,e . so please add your own historical facts in plae of those alphabets.

this program is perfectly as per your requirements
Attachments
output1.PNG (16 K) Download Preview

output2.PNG (18 K) Download Preview

JHistoricalFacts.java (1 K) Download Preview
label[] = new JLabel[5]; private int count = 0; public JHistoricalFacts() { setSize(400, 200); FlowLayout layout = new FlowLayout (); setLayout(layout); label[0] = new JLabel("A"); label[1] = new JLabel("B"); label[2] = new JLabel("C"); label[3] = new JLabel("D"); label[4]

Screenshots
Screenshot
Screenshot
Purchase Answer