Java Swing

23 responses on Java Swing

  1. 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.

    1. 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.

  2. 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();
    }

    }

  3. 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

  4. 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

    1. This depends on the level and how to create your interface includes what. Nói chung cần gì thì search đó 🙂

Leave a Reply

Nguyenvanquan7826 very desirable for you to leave feedback comments, Inquiries for the post as well as the Blog. But all feedback nature because the exercises are deleted households harshly and did not respond to!