 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
class
CalculatorPanel extends Jpanel
|
|
|
:
|
|
|
setLayout(new
BorderLayout());
|
|
|
//Component
and panel setup
|
|
|
JPanel eastPanel = new JPanel();
|
|
|
eastPanel.setLayout(new
BorderLayout());
|
|
|
//display
|
|
|
display = new JTextField(12);
|
|
|
display.setHorizontalAlignment(JTextField.RIGHT);
|
|
display.setEditable(false);
|
|
|
Color col = new
Color(255,255,255);
|
|
|
display.setBackground(col);
|
|
|
display.addKeyListener(this);
|
|
|
Font f = new
Font("MonoSpaced", Font.BOLD, 10);
|
|
|
display.setText("0");
|
|
|
eastPanel.add(display,
"North");
|
|