Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- class Button {
- static JButton button1 = new JButton();
- }
- class ButtonListener1 extends Button implements ActionListener {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1.setText("Привет");
- Font BigFontTR = new Font("TimesRoman", Font.BOLD, 100);
- button1.setFont(BigFontTR);
- }
- }
- public class Jitik extends ButtonListener1 {
- public static void main(String[] args) {
- JFrame frame = new JFrame("Jitik");
- frame.setSize(800, 1000);
- frame.setLocationRelativeTo(null);
- JPanel panel = new JPanel(new GridLayout(2, 1, 5, 5));
- frame.add(panel);
- panel.add(button1);
- button1.addActionListener(new ButtonListener1());
- frame.setVisible(true);
- String s = button1.getText();
- System.out.println(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement