Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DialogD extends JDialog {
- private JButton pbHideMe = new JButton("Hello DIALOG !!, Close ME");
- public DialogD() {
- this.setTitle("Dialog D Here");
- this.setModal(true);
- this.getContentPane().add(pbHideMe);
- pbHideMe.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- DialogD.this.setVisible(false);
- }
- })
- pbHitMe.setPreferredSize(new Dimension(100,100));
- this.pack();
- }
- }
- public class FormA extends JFrame {
- private JButton pbHitMe = new JButton("Hello FORM !!, Hit Me");
- public FormA() {
- this.setTitle("Form A Here");
- this.getContentPane().add(pbHitMe);
- pbHitMe.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- DialogD dd = new DialogD();
- dd.setVisible(true);
- }
- });
- pbHitMe.setPreferredSize(new Dimension(100,100));
- this.pack();
- }
- }
- public class RunMe {
- public static void main(String[] args) {
- FormA fa = new FormA();
- fa.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment