to viano(一地鸡毛) :
什么意思?具体方法?

解决方案 »

  1.   

    public class TestFrame extends JFrame {
        public TestFrame() throws HeadlessException {
             setTitle("TestFrame");
            Toolkit kit=Toolkit.getDefaultToolkit();
            Dimension dim=kit.getScreenSize() ;
            setBounds(dim.width /2,dim.height /2,dim.width /4,dim.height /4);        Container contentPane=getContentPane();
            TestPanel panel=new TestPanel();
            contentPane.add(panel);
            
            
        }
        private class TestPanel extends JPanel{
            public TestPanel() {
                setLayout(null);
                JTable table=new JTable();
                table.setBounds(//这里就可以控制了吧。。
                );
            }
        }    public static void main(String[] args) {
            TestFrame frame=new TestFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
            frame.setVisible(true);
             }
       
    }
      

  2.   

    setBounds(int x,int y,int width,int height);
    应该会用了吧。
      

  3.   

    这是不使用布局管理器。直接用setBounds()定位
    《Core java》里说的。
      

  4.   

    table.getTableHeader().setPreferredSize(new Dimension(1, 24));
      

  5.   

    多谢各位,myhotsun(科科) 正解.