Bonjour, je veux créer une interface avec un scrollPane mais je n'arrive pas à faire fonctionner le scrollpane, j'ai besoin de votre aide.
Voici mon code


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.GridLayout;
 
import javax.swing.JFrame;
import javax.swing.JPanel;
 
import java.awt.BorderLayout;
 
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;
 
public class TestScroll {
 
	private JFrame frame;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField_6;
	private JTextField textField_7;
	private JTextField textField_8;
	private JTextField textField_9;
 
	/**
         * Launch the application.
         */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					TestScroll window = new TestScroll();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
 
	/**
         * Create the application.
         */
	public TestScroll() {
		initialize();
	}
 
	/**
         * Initialize the contents of the frame.
         */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 1327, 748);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
 
 
		JPanel panel = new JPanel();
		frame.getContentPane().add(panel, BorderLayout.CENTER);
		panel.setLayout(null);
 
		JTextArea textArea = new JTextArea();
		textArea.setBounds(403, 100, 746, 536);
		panel.add(textArea);
 
		JButton btnNewButton = new JButton("New button");
		btnNewButton.setBounds(800, 760, 119, 20);
		panel.add(btnNewButton);
 
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(15, 235, 413, -225);
 
		panel.add(scrollPane);
 
		JLabel lblChamp = new JLabel("champ1");
		lblChamp.setBounds(15, 16, 69, 20);
		panel.add(lblChamp);
 
		JLabel lblChamp_1 = new JLabel("champ2");
		lblChamp_1.setBounds(15, 72, 69, 20);
		panel.add(lblChamp_1);
 
		textField = new JTextField();
		textField.setBounds(103, 13, 146, 26);
		panel.add(textField);
		textField.setColumns(10);
 
		textField_1 = new JTextField();
		textField_1.setBounds(99, 69, 146, 26);
		panel.add(textField_1);
		textField_1.setColumns(10);
 
		JLabel lblChamp_2 = new JLabel("champ3");
		lblChamp_2.setBounds(15, 128, 69, 20);
		panel.add(lblChamp_2);
 
		textField_2 = new JTextField();
		textField_2.setBounds(103, 125, 146, 26);
		panel.add(textField_2);
		textField_2.setColumns(10);
 
		JLabel lblChamp_3 = new JLabel("champ5");
		lblChamp_3.setBounds(15, 188, 69, 20);
		panel.add(lblChamp_3);
 
		textField_3 = new JTextField();
		textField_3.setBounds(103, 185, 146, 26);
		panel.add(textField_3);
		textField_3.setColumns(10);
 
 
 
		JLabel lblChamp_4 = new JLabel("champ6");
		lblChamp_4.setBounds(15, 257, 69, 20);
		panel.add(lblChamp_4);
 
		textField_4 = new JTextField();
		textField_4.setBounds(103, 254, 146, 26);
		panel.add(textField_4);
		textField_4.setColumns(10);
 
		JLabel lblChamp_5 = new JLabel("champ7");
		lblChamp_5.setBounds(15, 315, 69, 20);
		panel.add(lblChamp_5);
 
		textField_5 = new JTextField();
		textField_5.setBounds(103, 312, 146, 26);
		panel.add(textField_5);
		textField_5.setColumns(10);
 
 
 
		JLabel lblChamp_6 = new JLabel("champ8");
		lblChamp_6.setBounds(15, 387, 69, 20);
		panel.add(lblChamp_6);
 
		textField_6 = new JTextField();
		textField_6.setBounds(103, 384, 146, 26);
		panel.add(textField_6);
		textField_6.setColumns(10);
 
		JLabel lblChamp_7 = new JLabel("champ9");
		lblChamp_7.setBounds(15, 452, 69, 20);
		panel.add(lblChamp_7);
 
		textField_7 = new JTextField();
		textField_7.setBounds(103, 449, 146, 26);
		panel.add(textField_7);
		textField_7.setColumns(10);
 
		JLabel lblChamp_8 = new JLabel("champ10");
		lblChamp_8.setBounds(15, 536, 69, 20);
		panel.add(lblChamp_8);
 
		textField_8 = new JTextField();
		textField_8.setBounds(103, 533, 146, 26);
		panel.add(textField_8);
		textField_8.setColumns(10);
 
		JLabel lblChamp_9 = new JLabel("champ11");
		lblChamp_9.setBounds(15, 612, 69, 20);
		panel.add(lblChamp_9);
 
		textField_9 = new JTextField();
		textField_9.setBounds(103, 609, 146, 26);
		panel.add(textField_9);
		textField_9.setColumns(10);
 
 
		JLabel lblChamp_11 = new JLabel("champ11");
		lblChamp_11.setBounds(15, 736, 69, 20);
		panel.add(lblChamp_11);
 
		JTextField textField_11 = new JTextField();
		textField_11.setBounds(103, 736, 146, 26);
		panel.add(textField_11);
		textField_11.setColumns(11);
 
		JLabel lblChamp_12 = new JLabel("champ12");
		lblChamp_12.setBounds(15, 800, 69, 20);
		panel.add(lblChamp_12);
 
		JTextField textField_12 = new JTextField();
		textField_12.setBounds(103, 800, 146, 26);
		panel.add(textField_12);
 
 
		JLabel lblChamp_13 = new JLabel("champ13");
		lblChamp_13.setBounds(15, 1162, 69, 20);
		panel.add(lblChamp_13);
 
		JTextField textField_13 = new JTextField();
		textField_13.setBounds(103, 1162, 146, 26);
		panel.add(textField_13);
		textField_13.setColumns(13);	
 
 
		JLabel lblChamp_14 = new JLabel("champ13");
		lblChamp_14.setBounds(15, 1362, 69, 20);
		panel.add(lblChamp_14);
 
		JTextField textField_14 = new JTextField();
		textField_14.setBounds(103, 1362, 146, 26);
		panel.add(textField_14);
		textField_13.setColumns(14);	
 
	}	
 
 
}