I have been playing swing over the past few days and used a visual swing plug-in. This plug-in is very powerful. Code generation is also easy to understand. I added a jtable to the frame. I want to see a horizontal scroll bar. By default, it will not happen. I found some information to see it, it is found that there are too few materials. Finally solved. In this case:
If (jtable0 = NULL) {<br/> jtable0 = new jtable (); <br/> jtable0.setmodel (New defaulttablemodel (new object [] [] {"0x0", "0x1", "0x2 "}, {"1x0", "1x1", "1X2"}, {"1x0", "1x1", "1X2 "}, {"1x0", "1x1", "1X2"}, {"1x0", "1x1", "1X2 "}, {"1x0", "1x1", "1X2"}, {"1x0", "1x1", "1X2 "}, {"1x0", "1x1", "1X2"}, {"1x0", "1x1", "1X2 "}, {"1x0", "1x1", "1X2"}, {"1x0", "1x1", "1X2 "}, {"1x0", "1x1", "1X2" },}, New String [] {"title asdasdasds0", "titlasdasdase 1 ", "title2asdasdasd "})... </P> <p> jtable0.setautoresizemode (jtable. auto_resize_off); <br/> for (INT I = 0; I <3; I ++) {<br/> Tc = jtable0.getcolumnmodel (). getcolumn (I); <br/> TC. setpreferredwidth (100); <br/>}< br/>
Note that the obtained header is configured with preferredwidth instead of width.