Jtable表头显示不出来 求大神帮我改改?
package日历;importjava.awt.EventQueue;importjavax.swing.JFrame;importjavax.swing.JPanel...
package 日历;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
public class calendar_1 extends JFrame {
private JPanel contentPane;
private JTable rilibiao;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
calendar_1 frame = new calendar_1();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.4
*/
public calendar_1() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 958, 586);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
String a[][]=new String[6][7];
String colName[]= {"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
rilibiao = new JTable(a,colName);
rilibiao.setRowHeight(50);
JScrollPane rilibiao = new JScrollPane(rilibiao);
rilibiao.setBounds(133, 88, 484, 323);
contentPane.add(rilibiao);
}
} 展开
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EmptyBorder;
import javax.swing.JTable;
public class calendar_1 extends JFrame {
private JPanel contentPane;
private JTable rilibiao;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
calendar_1 frame = new calendar_1();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.4
*/
public calendar_1() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 958, 586);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
String a[][]=new String[6][7];
String colName[]= {"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
rilibiao = new JTable(a,colName);
rilibiao.setRowHeight(50);
JScrollPane rilibiao = new JScrollPane(rilibiao);
rilibiao.setBounds(133, 88, 484, 323);
contentPane.add(rilibiao);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询