📄 sw5.java
字号:
/*
JTable
Class
Used to show the informations as Row,Col format
cons:
JTable(String datas[][],String title[])
Note:
If we run this program we can't see the Title
To see the title we have to attach the JTable to JScrollPane
*/
import java.awt.*;
import javax.swing.*;
class sw5 extends JFrame
{
JTable t1;
public sw5()
{
Container con = getContentPane();
String d[][] = { {"1","Rin","20"},{"2","Lux","30"},{"3","Det","50"} };
String t[] = {"Pno","Pname","Qty"};
t1 = new JTable(d,t);
con.add(t1);
setSize(300,300);
setVisible(true);
}
public static void main(String args[])
{
new sw5();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -