Hajj-simulation/src/EventControll.java

57 lines
1.4 KiB
Java
Raw Normal View History

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;
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;
//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();
frame.getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
2020-12-08 23:26:32 +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) {
//lblNewLabel.setText(A.toString());
2020-12-08 23:26:32 +01:00
}
}