2020-12-08 23:26:32 +01:00
|
|
|
import java.awt.EventQueue;
|
|
|
|
import javax.swing.JFrame;
|
|
|
|
import javax.swing.JLabel;
|
|
|
|
import java.awt.BorderLayout;
|
|
|
|
import javax.swing.JPanel;
|
|
|
|
import java.awt.Font;
|
2020-12-11 14:40:25 +01:00
|
|
|
import java.awt.Color;
|
|
|
|
import javax.swing.JScrollBar;
|
|
|
|
import javax.swing.JTextField;
|
|
|
|
import java.awt.FlowLayout;
|
|
|
|
import java.awt.GridBagLayout;
|
|
|
|
import java.awt.GridBagConstraints;
|
|
|
|
import java.awt.Insets;
|
|
|
|
import javax.swing.JScrollPane;
|
2020-12-08 23:26:32 +01:00
|
|
|
|
|
|
|
public class EventControll {
|
|
|
|
|
|
|
|
private JFrame frame;
|
2020-12-11 14:40:25 +01:00
|
|
|
//private JTextField textField;
|
|
|
|
private JTextField textField_2;
|
|
|
|
private JTextField textField_3;
|
|
|
|
private JTextField textField_4;
|
2020-12-08 23:26:32 +01:00
|
|
|
public static void main(String[] args) {
|
|
|
|
EventQueue.invokeLater(new Runnable() {
|
|
|
|
public void run() {
|
|
|
|
try {
|
|
|
|
EventControll window = new EventControll();
|
|
|
|
window.frame.setVisible(true);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public EventControll() {
|
|
|
|
initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void initialize() {
|
|
|
|
frame = new JFrame();
|
2020-12-11 14:40:25 +01:00
|
|
|
frame.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
2020-12-08 23:26:32 +01:00
|
|
|
|
2020-12-11 14:40:25 +01:00
|
|
|
for (int i = 0; i<10 ; i++) {
|
|
|
|
JTextField textField = new JTextField();
|
|
|
|
int x =(int)(((double)i/9.0)*255);
|
|
|
|
textField.setBackground(new Color(255,x,0));
|
|
|
|
frame.getContentPane().add(textField);
|
|
|
|
textField.setColumns(10);
|
|
|
|
}
|
2020-12-08 23:26:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setData(Object A) {
|
2020-12-11 14:40:25 +01:00
|
|
|
//lblNewLabel.setText(A.toString());
|
2020-12-08 23:26:32 +01:00
|
|
|
}
|
|
|
|
}
|