KeyPadPanel.java:55: addActionListener(java.awt.event.ActionListener) in javax.swing.AbstractButton cannot be applied to (KeyPadPanel)
ÏÏ§Ï b1.addActionListener(this);
ÏÏ§Ï ^
This is the code I have:
[FONT=Courier New][COLOR=#0000ff]
[FONT=Courier New][COLOR=#0000ff]1 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]import[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] java.awt.*;[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]2 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]import[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] java.awt.event.*;[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]3 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]import[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] javax.swing.*;[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]4 [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff]5 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]6 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]public[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]class[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] KeyPadPanel [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]extends[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JPanel[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]7 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]{[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]8 [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff]9 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]private[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JTextField textfield;[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]10 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]11 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]public[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] KeyPadPanel()[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]12 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]{[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]13 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JPanel keys = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JPanel();[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]14 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.setLayout([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] GridLayout(4, 3));[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]15 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]16 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b1 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"1"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]17 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b2 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"2"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]18 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b3 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"3"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]19 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b4 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"4"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]20 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b5 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"5"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]21 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b6 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"6"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]22 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b7 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"7"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]23 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b8 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"8"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]24 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b9 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"9"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]25 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton bPound = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"*"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]26 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton b0 = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"0"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]27 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton bStar = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"#"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]28 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]29 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b1);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]30 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b2);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]31 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b3);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]32 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b4);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]33 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b5);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]34 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b6);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]35 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b7);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]36 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b8);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]37 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b9);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]38 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (bStar);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]39 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (b0);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]40 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]keys.add (bPound);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]41 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]42 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]43 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]44 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JPanel base = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JPanel();[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]45 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]base.setLayout([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] BorderLayout());[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]46 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]47 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JButton bclear = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JButton([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"clear"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]48 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]textfield = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JTextField(10);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]49 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]50 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]add(keys, BorderLayout.CENTER); [/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]51 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]add(bclear, BorderLayout.EAST);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]52 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]add(textfield, BorderLayout.NORTH);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]53 [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff]54 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]55 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b1.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]56 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b2.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]57 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b3.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]58 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b4.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]59 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b5.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]60 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b6.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]61 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b7.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]62 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b8.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]63 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b9.addActionListerner([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]64 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]bPound.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]65 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]b0.addActionListener([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]66 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]bStar.addActionListner([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]67 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]bclear.addActionListner([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]this[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]68 [/COLOR][/FONT][/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]69 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]}[/FONT]
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]70[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]} [/FONT]
The driver program:
[FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]
1 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]import[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] javax.swing.*;
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]2
3
4 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]public[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]class[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] KeyPadDemo
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]5 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]{
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]6
7 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New][/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]public[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]static[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]void[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] main (String[] args)
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]8 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]{
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]9 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]JFrame frame = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] JFrame ([/FONT][FONT=Courier New][COLOR=#00cb00][FONT=Courier New][COLOR=#00cb00]"Key Pad Demo"[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]10 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]11 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]12 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]KeyPadPanel panel = [/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]new[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New] KeyPadPanel();
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]13 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]14 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]frame.getContentPane().add(panel);
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]15 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]frame.pack();
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]16 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]frame.setVisible([/FONT][FONT=Courier New][COLOR=#941edf][FONT=Courier New][COLOR=#941edf]true[/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]);
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]17 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]}
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]18 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]
[/FONT][FONT=Courier New][COLOR=#0000ff][FONT=Courier New][COLOR=#0000ff]19 [/COLOR][/FONT][/COLOR][/FONT][FONT=Courier New]}
[/FONT]


Sign In
Create Account


Back to top









