Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication3;
- /**
- *
- * @author chaos
- */
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- public class Finestra_errore extends JFrame {
- public Finestra_errore()
- {
- super();
- }
- public Finestra_errore(String numerrore,String Tipoerrore)
- {
- JFrame error = new JFrame("Errore: " + numerrore);
- JPanel container = new JPanel();
- error.add(container,BorderLayout.CENTER);
- error.setVisible(true);
- error.setSize(300,250);
- JLabel tipoerrorex = new JLabel(Tipoerrore);
- JButton compreso = new JButton("ok");
- compreso.addActionListener(new distruttorefinestra());
- container.add(tipoerrorex);
- container.add(compreso);
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- }
- private class distruttorefinestra implements ActionListener{
- @Override
- public void actionPerformed(ActionEvent e)
- {
- if(e.getActionCommand().equalsIgnoreCase("ok"))
- {
- dispose();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement