Mình không hiểu lắm dòng lệnh này.xem video mình code dc ntn
mn thông cảm.tại ms làm quen vs swing sợ quên cách dùng nên cmt dễ nhớ ^^
package swing.app;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
public class SwingApp {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable(){
public void run() {
JFrame sc=new JFrame("Welcome to my app");
sc.setVisible(true); // hiện giao diện
sc.setResizable(true); // nút cho phép kéo giao diện,nếu là false thì ko kéo dc.còn ko cần câu lệnh trên là đủ
sc.setSize(600,600); //thiết lập kích thước
sc.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// nút tắt mặc định bản cũ(bao hàm trong setvisible
}
});
}
}
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?