#JTabbedPane

e836. 设置JTabbedPane中卡片的提示语

Therearetwowaystosetatooltiponatab.Thefirstistospecifyitwhenthetabiscreated;thesecondwayistosetitusingJTabbedPane.setToolTipTextAt().//CreateatabbedpaneJTabbedP...

e834. 设置JTabbedPane中卡片的位置

Thetabsofatabbedpanecanbeplacedononeofthefouredgesofitscontainer.Bydefault,whenatabbedpaneiscreated,thetabsareplacedontop.//CreateatabbedpanewiththetabsontopJTa...

e837. 设置JTabbedPane中卡片的颜色

//CreateatabbedpaneJTabbedPanepane=newJTabbedPane();//Setthetextcolorforalltabspane.setForeground(Color.YELLOW);//Setthebackgroundcolorforalltabspane.setBackgro...

e829. 获得和设置JTabbedPane 的卡片

//Tocreateatabbedpane,seee828创建JTabbedPane//GettheindexofthecurrentlyselectedtabintselIndex=pane.getSelectedIndex();//SelectthelasttabselIndex=pane.getTabCount(...

e831. 从JTabbedPane中删除一个卡片

//Tocreateatabbedpane,seee828创建JTabbedPane//Removethelasttabpane.remove(pane.getTabCount()-1);//Removethetabwiththespecifiedchildcomponentpane.remove(component)...

e832. 从JTabbedPane中移动卡片

Tomoveatab,itmustfirstberemovedandthenreinsertedintothetabbedpaneasanewtab.Unfortunately,sincethereisnoobjectthatrepresentsatab,itisnecessarytorecordallofthetab...

e839. 使JTabbedPane中的卡片可滚动

Bydefault,allthetabsinatabbedpanearedisplayed.Whenthetabsarewiderthanthewidthofthetabbedpane,theyaredisplayedinrows.Ifspaceisanissue,itispossibletoconfigurethet...

e838. 使JTabbedPane中的卡片能用按键的方式选取

Settingamnemoniconataballowsthetabtobeselectedwithakeystroke.Forexample,ifthemnemonicforatabwerethekeyL,thentypingALT-L(onWindows)wouldselectthetab.//Createatab...

e833. 获得JTabbedPane中的卡片

Thisexampleretrievesallthetabsinatabbedpane://Tocreateatabbedpane,seee828创建JTabbedPane//Getnumberoftabsintcount=pane.getTabCount();//Getthepropertiesofeachtabfo...

e840. 监听JTabbedPane中选中卡片的改变

Atabbedpanefiresachangeeventwhenevertheselectedtabischangedeitherbytheuserorprogrammatically.//CreatethetabbedpaneJTabbedPanepane=newJTabbedPane();//Addtabs...;...

e835. 使JTabbedPane中的卡片生效和失效

Bydefault,allnewtabsareenabled,whichmeanstheusercanselectthem.Atabcanbedisabledtopreventtheuserfromselectingit.//CreateatabbedpaneJTabbedPanepane=newJTabbedPane...

e830. 向JTabbedPane中加入一个卡片

Thisexampledemonstratesvariouswaystoaddatabtoatabbedpane.//CreateatabbedpaneJTabbedPanepane=newJTabbedPane();//Addatabwithalabeltakenfromthenameofthecomponentco...

e828. 创建JTabbedPane

Atabbedpaneisacontainerthatdisplaysonlyonechildcomponentatatime.Typically,thechildrenarethemselvescontainersofothercomponents.Eachchildisassociatedwithavisiblet...
代码星球 ·2021-02-12