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. |
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.JPanel;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import javax.swing.JTextField;
import java.awt.Insets;
import java.awt.*;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.text.MaskFormatter;
import javax.swing.DefaultComboBoxModel;
import oj.*;
public class ClientPanel extends JFrame {
private JTextField textField;
private JTextField textField_1;
private JTextField textField_2;
private JTextField textField_3;
private JTextField textField_4;
public ClientPanel() {
JLayeredPane jlp=new JLayeredPane();
this.getContentPane().add(jlp);
JPanel mainPanel=new JPanel();
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{100, 125, 130, 0};
gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
mainPanel.setLayout(gridBagLayout);
GridBagConstraints gbc_textField = new GridBagConstraints();
gbc_textField.fill = GridBagConstraints.HORIZONTAL;
gbc_textField.gridwidth = 2;
gbc_textField.insets = new Insets(0, 0, 5, 0);
gbc_textField.gridx = 1;
gbc_textField.gridy = 0;
JLabel lblNewLabel = new JLabel("Nazwa:");
GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
gbc_lblNewLabel.anchor = GridBagConstraints.EAST;
gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
gbc_lblNewLabel.gridx = 0;
gbc_lblNewLabel.gridy = 0;
textField = new JTextField();
mainPanel.add(textField,gbc_textField);
mainPanel.add(lblNewLabel,gbc_lblNewLabel);
mainPanel.setBounds(0,0,1000,1000);
jlp.add(mainPanel,new Integer(200));
//here add something in front of mainPanel
JPanel second=new JPanel();
second.add(new JLabel("sssssssssssss"));
second.setLayout(new FlowLayout());
second.setBounds(0,0,1000,1000);
jlp.add(second,new Integer(300));
}
}
|