本文整理汇总了Java中javax.swing.JCheckBoxMenuItem.isSelected方法的典型用法代码示例。如果您正苦于以下问题:Java JCheckBoxMenuItem.isSelected方法的具体用法?Java JCheckBoxMenuItem.isSelected怎么用?Java JCheckBoxMenuItem.isSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JCheckBoxMenuItem
的用法示例。
在下文中一共展示了JCheckBoxMenuItem.isSelected方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setShowEditorToolbar
import javax.swing.JCheckBoxMenuItem; //导入方法依赖的package包/类
private static boolean setShowEditorToolbar( boolean show ) {
boolean res = true;
Action toggleEditorToolbar = FileUtil.getConfigObject( "Editors/Actions/toggle-toolbar.instance", Action.class ); //NOI18N
if( null != toggleEditorToolbar ) {
if( toggleEditorToolbar instanceof Presenter.Menu ) {
JMenuItem menuItem = ((Presenter.Menu)toggleEditorToolbar).getMenuPresenter();
if( menuItem instanceof JCheckBoxMenuItem ) {
JCheckBoxMenuItem checkBoxMenu = ( JCheckBoxMenuItem ) menuItem;
res = checkBoxMenu.isSelected();
if( checkBoxMenu.isSelected() != show ) {
try {
toggleEditorToolbar.actionPerformed( new ActionEvent( menuItem, 0, "")); //NOII18N
} catch( Exception ex ) {
//don't worry too much if it isn't working, we're just trying to be helpful here
Logger.getLogger( EditorOnlyDisplayer.class.getName()).log( Level.FINE, null, ex );
}
}
}
}
}
return res;
}
示例2: headerMenuChanged
import javax.swing.JCheckBoxMenuItem; //导入方法依赖的package包/类
private void headerMenuChanged(String col, JCheckBoxMenuItem source) {
int index = this.getColumnModel().getColumnIndex(col); // real index
if (!source.isSelected()) {
int tv = 0;
for (int i = 0; i < this.getColumnCount(); i++) {
tv += this.getColumnModel().getColumn(i).getWidth();
}
if (tv == this.getColumn(col).getWidth()) {
source.setSelected(true);
return;
}
this.originalColumsWidth.set(this.columnNames.indexOf(col), new Integer(this.getColumnModel().getColumn(index)
.getWidth()));
this.getColumnModel().getColumn(index).setMaxWidth(0);
this.getColumnModel().getColumn(index).setMinWidth(0);
this.getColumnModel().getColumn(index).setWidth(0);
this.getColumnModel().getColumn(index).setPreferredWidth(0);
this.getTableHeader().resizeAndRepaint();
} else {
this.getColumnModel().getColumn(index).setMaxWidth(2147483647);
this.getColumnModel().getColumn(index)
.setPreferredWidth(this.originalColumsWidth.get(this.columnNames.indexOf(col)).intValue());
this.getColumnModel().getColumn(index)
.setWidth(this.originalColumsWidth.get(this.columnNames.indexOf(col)).intValue());
this.originalColumsWidth.set(this.columnNames.indexOf(col), Integer.valueOf(0));
this.getTableHeader().resizeAndRepaint();
}
}
示例3: actionPerformed
import javax.swing.JCheckBoxMenuItem; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
JCheckBoxMenuItem itemShowExplorer = (JCheckBoxMenuItem) e.getSource();
if(itemShowExplorer.isSelected()){
PrincipalWindow.panelEast.setVisible(true);
PrincipalWindow.splitPane.setDividerLocation(StartApplication.frame.getWidth()-250);
}
else{
PrincipalWindow.panelEast.setVisible(false);}
}
示例4: actionPerformed
import javax.swing.JCheckBoxMenuItem; //导入方法依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
JCheckBoxMenuItem itemShowConsole = (JCheckBoxMenuItem) e.getSource();
if(itemShowConsole.isSelected()){
PrincipalWindow.tabbedPaneConsole.setVisible(true);
PrincipalWindow.splitPane_1.setDividerLocation(StartApplication.frame.getHeight()-300);
}
else{
PrincipalWindow.tabbedPaneConsole.setVisible(false);}
}