{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

AGE Calculator Class.docx

AGE Calculator Class.docx - AGE Calculator Class java HW...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
AGE Calculator Class – java HW code with Text Box import javax.swing.*; import javax.xml.crypto.Data; import java.util.Date; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class AgeCalculator extends JFrame implements ActionListener{ TextField textField; JLabel label; public AgeCalculator(){ initUI(); } private void initUI() { setTitle("Age calculator"); setSize(300, 200); setLocationRelativeTo(null); setDefaultCloseOperation(EXIT_ON_CLOSE); // controls
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
JButton calculateButton = new JButton("calculate age"); calculateButton.addActionListener(this); textField = new TextField("Enter year of birth: ", 10);
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}