Synthesis of articles on Java Swing order from basic
- Hello Java Swing
- JLabel
- JButton
- JTextField
- JPanel
- Layout Managers
- FlowLayout
- GridLayout
- BorderLayout
- BoxLayout
- GridBagLayout
- CardLayout
- SpringLayout
- GroupLayout
- JTextArea trong Java – JTextArea in Java
- JPasswordField trong Java – JPasswordField in Java
- JCheckBox trong Java – JCheckBox in Java
- JRadioButton trong Java – JRadioButton in java
- JComboBox trong Java – JComboBox in Java
- JTabbedPane in Java
- Customize JTabbedPane
- JMenu in Java
- JToolBar in Java
- Border in java
- JList trong Java – JList in Java
- Customize JList - JList custom renderer
- FlowLayout
- GridLayout
- BorderLayout
- BoxLayout
- GridBagLayout
- CardLayout
- SpringLayout
- GroupLayout
Good. Add the table anymore children. Nói thêm về MVC trong nó nữa 😀
I'm writing this series unfinished unfinished. The table to write because I do not see 1 TUT 9 nice article codesontrang, to lead on this link.
MVC sẽ có 😀
Haha, before you see the Table also from that page. 😀
=)) Yes, the author wrote that article or make a lot of java swing =))
no dear JScrollPane
to, I'm writing this series in progress, 😀 sẽ cập nhật đủ các đối tượng cơ bản trong thời gian tới nhé!
E hello sir
Waiter e want to ask you some. Now e're doing 1 Figure began chasing game like that, sir words on the AppStore. She designed by Swing, e now want to make the question retrieval from database "ever" question 1 to give players the answer implement an e How is sir. I thank you very much.
To do so, you need to connect to your database. then get down and load up the frame. Also on display for each question, you use 1 loop only. in the loop you give it up, if the answer is correct, then the next, not the only.
He asked for the file ending with e dij why he created it so.
there are
anh cho em hoi tai sao cai panelTextFiled set layout(null) thi textField va label hien thi duoc. con panelButton va panelTable setLayout(null) thi ko the hien thi duoc vay a.
code
package Table;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.BorderFactory;
import javax.swing.border.TitledBorder;
@SuppressWarnings(“serial”)
public class TableApp extends JFrame{
private JPanel panelTableApp,panelTableStudent, panelTextField, panel button;
private JLabel labelIDStudent, labelNameStudent, label address student, labelSelect;
private JTextField textFieldIDStudent, textFieldNameStudent, textFieldAddressStudent;
private JButton buttonPush, buttonPop, buttonUpdate, buttonSearch;
private JTable tableStudent;
private ModelTableApp modelTableStudent;
public TableApp() {
super(“Table Application”);
setSize(600, 750);
setVisible(true);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().add(createPanelTableApp());
}
private JPanel createPanelTableApp() {
panelTableApp = new JPanel();
panelTableApp.setLayout(null);
panelTableApp.setBounds(25, 25, 550, 700);
panelTableApp.setBorder(BorderFactory.createTitledBorder(null, null, TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION));
panelTableApp.add(createPanelTextField());
panelTableApp.add(createPanelButton());
panelTableApp.add(createPanelTableStudent());
return panelTableApp;
}
private JPanel createPanelTextField() {
panelTextField = new JPanel();
panelTextField.setLayout(null);
panelTextField.setBounds(25, 25, 550, 250);
panelTextField.setBorder(BorderFactory.createTitledBorder(null, null,TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION));
panelTextField.add(createLabelIDStudent());
panelTextField.add(createLabelNameStudent());
panelTextField.add(createLabelAddressStudent());
panelTextField.add(createTextFieldIDStudent());
panelTextField.add(createTextFieldNameStudent());
panelTextField.add(createTextFieldAddressStudent());
return panelTextField;
}
private JPanel createPanelButton() {
panelButton = new JPanel();
panelButton.setLayout(new GridLayout(1, 1, 25, 1));
panelButton.setBounds(25, 300, 550, 35);
panelButton.setBorder(BorderFactory.createTitledBorder(null, null,TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION));
panelButton.add(createButtonPush());
panelButton.add(createButtonPop());
panelButton.add(createButtonUpdate());
panelButton.add(createButtonSearch());
return panelButton;
}
private JPanel createPanelTableStudent() {
panelTableStudent = new JPanel();
panelTableStudent.setLayout(new GridLayout());
panelTableStudent.setBounds(25, 360, 550, 350);
panelTableStudent.setBorder(BorderFactory.createTitledBorder(null, null, TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION));
panelTableStudent.add(new JScrollPane(createTableStudent()));
return panelTableStudent;
}
private JLabel createLabelIDStudent() {
labelIDStudent = new JLabel(“ID”);
labelIDStudent.setBounds(25, 35, 75, 25);
return labelIDStudent;
}
private JLabel createLabelNameStudent() {
labelNameStudent = new JLabel(“Name”);
labelNameStudent.setBounds(25, 115, 75, 25);
return labelNameStudent;
}
private JLabel createLabelAddressStudent() {
labelAddressStudent = new JLabel(“Address”);
labelAddressStudent.setBounds(25, 190, 75, 25);
return labelAddressStudent;
}
private JTextField createTextFieldIDStudent() {
textFieldIDStudent = new JTextField();
textFieldIDStudent.setBounds(125, 25, 375, 50);
return textFieldIDStudent;
}
private JTextField createTextFieldNameStudent() {
textFieldNameStudent = new JTextField();
textFieldNameStudent.setBounds(125, 100, 375, 50);
return textFieldNameStudent;
}
private JTextField createTextFieldAddressStudent() {
textFieldAddressStudent = new JTextField();
textFieldAddressStudent.setBounds(125, 175, 375, 50);
return textFieldAddressStudent;
}
private JButton createButtonPush() {
buttonPush = new JButton(“Push”);
buttonPush.setBounds(125, 250, 75, 25);
return buttonPush;
}
private JButton createButtonPop() {
buttonPop = new JButton(“Pop”);
return buttonPop;
}
private JButton createButtonUpdate() {
buttonUpdate = new JButton(“Update”);
return buttonUpdate;
}
private JButton createButtonSearch() {
buttonSearch = new JButton(“Search”);
return buttonSearch;
}
private JTable createTableStudent() {
tableStudent = new JTable();
tableStudent.setModel(createModelTableStudent());
return tableStudent;
}
private ModelTableApp createModelTableStudent() {
modelTableStudent = new ModelTableApp();
return modelTableStudent;
}
public static void build() {
new TableApp();
}
}
I give the command setVisible(true); bottom jaw nhé.
bài học rất bổ ích ạ. e đang học theo.
thank you. mong anh làm thật nhiều dạng ntn để bọn e tham khảo 😀
<3
bác có bài hd về MVC ko? e xin với…đang cần….tks bác!
Rất tiếc là không bạn ah.
Anh cho em hỏi có video nào để học cách kéo thả giao diện với windowBuilder không ạ.
Cái nàu a ko.
có phần mềm lập trình java ko
mấy anh lập trình bằng gì
xin link download với
Bạn có thể dùng eclipse hoặc netbean. Bạn lên google srach là khối 😉
hello sir. Kids also learn about the java language new . On the traffic class 1 bt do 1 app = java language dictionary . He asked if I wanted to design 1 the dictionary interface, you need to learn the lessons which of all on ạ ?? At e can not really be temporary tg nh sure not graduated @@ DC
This depends on the level and how to create your interface includes what. Nói chung cần gì thì search đó 🙂
đại loại giao diện chỉ cần chỗ nhập từ và tùy chọn chỉnh Anh-Việt , Việt-Anh thôi ạ