All pastes #978815 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-04-09 20:54 UTC
rendered paste body
import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Test extends JFrame {
    public static void main(String[] args) {
        Test app = new Test();
        app.setVisible(true);
    }

    public Test() {
        JButton radioWindowBtn = new JButton("Show Window");
        radioWindowBtn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                displayWindow();
            }
        });
        getContentPane().add(radioWindowBtn);
    }

    protected void displayWindow() {
        JFrame frame = new JFrame();
        frame.getContentPane().add(new JRadioButton("Testing"));
        frame.setVisible(true);
    }
}