1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| public class Testt extends JFrame {
public Testt() {
super("frame");
this.setSize(200, 200);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel pano = new JPanel();
pano.setLayout(null);
pano.setBounds(0,0,200,200);
JButton boutan = new JButton("JButton");
boutan.setBounds(0,0,100,300);
pano.add(boutan);
JScrollPane scrollPane = new JScrollPane(pano);
this.add(scrollPane);
}
public static void main(String[] args) {
new Testt().setVisible(true);;
}
} |
Partager