[問題] java layout/Tab

看板java作者 (鴆羅)時間12年前 (2012/05/28 22:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
已經爬文了 我現在用的是Gridbaglayout layout部分設定程式如下 constraints.weightx = 1; constraints.weighty = 1; constraints.fill = GridBagConstraints.BOTH; addComponent( panelForOptions , 0 , 0 , 2 , 1 ); //另外自訂function設定座標+width+height 可是他長成這樣 http://ppt.cc/Fgh8 我希望她的tab是平行的 不曉得要怎麼用? 沒用layout以前是平行的 可是不會隨視窗大小改變tab部分的大小 tab部分程式如下 options = new JTabbedPane(); //words words = new JPanel(); options.addTab( "Words" , null , words , "First Panel" ); //read read = new JPanel(); options.addTab( "Read" , null , read , "Second Panel" ); //review review = new JPanel(); options.addTab( "Review" , null , review , "Third Panel" ); //exam exam = new JPanel(); options.addTab( "Exam" , null , exam , "Forth Panel" ); panelForOptions = new JPanel(); panelForOptions.add( options ); 會多一個panelForOptions是想看看是不是因為直接+tab進去contraint的關係 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.140.175
文章代碼(AID): #1Fmue0Nv (java)
文章代碼(AID): #1Fmue0Nv (java)