java - How to add JSplitPane between the JTabbedPane and its components? -
this code given below as:
thejtabbedpane.addtab(coding, new javax.swing.imageicon(getclass().getresource("/com/sysvine/healthpractice/gui/images/tablet.png")), apaneldiagicd);//constant.gettextbundle("5.การวินิจฉัย") apaneldiagicd.addpanel(constant.gettextbundle("การลงรหัส icd-10"), apaneldiagicd10); apaneldiagicd.addpanel(constant.gettextbundle("การลงรหัส icd-9"), apaneldiagicd9); i need add together jsplitpane between jtabbedpane , component. tabbed pane consists of 9 tabs. in each tab consists of different functionality different panel. added tabbed pane. how can set split pane between them, , left , right component split pane?
splitpaneh= new javax.swing.jsplitpane(); splitpaneh.setorientation(javax.swing.jsplitpane.horizontal_split); splitpaneh.setdividerlocation(0); splitpaneh.setonetouchexpandable(true); splitpaneh.setleftcomponent( thejtabbedpane ); //splitpaneh.setrightcomponent( asourcetabbedpane );
you can't separate tabs contents component jsplitpane.
however can tell jtabbedpane how , want tabs layed out. @ constructors jtabbedpane(int tabplacement) , jtabbedpane(int tabplacement, int tablayoutpolicy) (there setters/getters these).
for tab placement utilize jtabbedpane.left, or jtabbedpane.right , result want achieve.
if have many tabs, can take between jtabbedpane.wrap_tab_layout or jtabbedpane.scroll_tab_layout. first display tabs in multiple rows/cols if needed, latter 1 display many fits space , display scroll buttons scroll not visible tabs.
if want separate tabs contents jsplitpane, can't utilize jtabbedpane this. have implement yourself. e.g. set buttons (representing tabs) on 1 side of jsplitpane, , when buttons clicked, alter component on other side of jsplitpane.
java swing jtabbedpane java-6 jsplitpane
No comments:
Post a Comment