本文整理匯總了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);}
}