本文整理了Java中javax.swing.JPanel.addFocusListener()
方法的一些代码示例,展示了JPanel.addFocusListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPanel.addFocusListener()
方法的具体详情如下:
包路径:javax.swing.JPanel
类名称:JPanel
方法名:addFocusListener
暂无
代码示例来源:origin: uwolfer/gerrit-intellij-plugin
private void indicateFocusing() {
myPanel.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(@NotNull FocusEvent e) {
myPanel.setBorder(FOCUSED_BORDER);
}
@Override
public void focusLost(@NotNull FocusEvent e) {
myPanel.setBorder(UNFOCUSED_BORDER);
}
});
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
/**
* Registers FocusListener to receive events.
* @param listener The listener to register.
*/
public synchronized void addFocusListener(FocusListener listener) {
if (listenerList == null ) {
listenerList = new EventListenerList();
}
listenerList.add(FocusListener.class, listener);
super.addFocusListener(listener);
}
代码示例来源:origin: girtel/Net2Plan
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
JPanel panel = new JPanel(new BorderLayout());
panel.add(editor.getTableCellEditorComponent(table, value, isSelected, row, column));
panel.add(customEditorButton, BorderLayout.EAST);
this.table = table;
this.row = row;
this.column = column;
panel.addFocusListener(FOCUS_LISTENER);
return panel;
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
/**
* Registers FocusListener to receive events.
* @param listener The listener to register.
*/
public synchronized void addFocusListener(FocusListener listener) {
if (listenerList == null) {
listenerList = new EventListenerList();
}
listenerList.add(FocusListener.class, listener);
super.addFocusListener(listener);
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
/**
* Registers FocusListener to receive events.
* @param listener The listener to register.
*/
public synchronized void addFocusListener(FocusListener listener) {
if (listenerList == null ) {
listenerList = new EventListenerList();
}
listenerList.add(FocusListener.class, listener);
super.addFocusListener(listener);
}
代码示例来源:origin: net.sf.ingenias/editor
private void jbInit() throws Exception {
jLabel1.setText("You can define properties value at the middle column");
this.getContentPane().setLayout(borderLayout1);
cancel.setText("Cancel");
cancel.addActionListener(new PropertiesWindow_cancel_actionAdapter(this));
ok.setText("OK");
ok.addActionListener(new PropertiesWindow_ok_actionAdapter(this));
central.setLayout(borderLayout2);
table.addFocusListener(new PropertiesWindow_table_focusAdapter(this));
this.getContentPane().add(jLabel1, BorderLayout.NORTH);
this.getContentPane().add(jPanel1, BorderLayout.SOUTH);
jPanel1.add(ok, null);
jPanel1.add(cancel, null);
this.getContentPane().add(central, BorderLayout.CENTER);
central.add(jScrollPane1, BorderLayout.CENTER);
// central.add(table.getTableHeader(),BorderLayout.NORTH);
jScrollPane1.getViewport().add(table, null);
}
代码示例来源:origin: org.jspresso/jspresso-swing-components
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(
0, 0, 0, 0), 0, 0));
super.addFocusListener(new FocusAdapter() {
代码示例来源:origin: org.jspresso.framework/jspresso-swing-components
add(textField, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
new Insets(0, 0, 0, 0), 0, 0));
super.addFocusListener(new FocusAdapter() {
代码示例来源:origin: com.synaptix/SynaptixSwing
private void initComponents() {
cardLayout = new CardLayout();
labelPanel = new JPanel(cardLayout);
labelPanel.setBorder(new EtchedBorder(EtchedBorder.RAISED));
labelPanel.setFocusable(true);
labelPanel.addFocusListener(new MyFocusListener());
labelPanel.setTransferHandler(new MyTransferHandler());
labelPanel.addMouseListener(new MyMouseListener());
labelPanel.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK), "doCopy"); //$NON-NLS-1$
labelPanel.getActionMap().put("doCopy", TransferHandler.getCopyAction()); //$NON-NLS-1$
labelPanel.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK), "doPaste"); //$NON-NLS-1$
labelPanel.getActionMap().put("doPaste", //$NON-NLS-1$
TransferHandler.getPasteAction());
imageComponent = new JImage();
labelPanel.add(imageComponent, "image"); //$NON-NLS-1$
waitGlassPane = new JWaitGlassPane();
labelPanel.add(waitGlassPane, "wait"); //$NON-NLS-1$
noImageLabel = new JLabel(SwingMessages.getString("JImageCropping.6"), JLabel.CENTER); //$NON-NLS-1$
labelPanel.add(noImageLabel, "noImage"); //$NON-NLS-1$
cardLayout.show(labelPanel, "noImage"); //$NON-NLS-1$
popupMenu = new JPopupMenu();
popupMenu.add(new PasteAction());
cropButton = new JButton(cropAction);
}
代码示例来源:origin: kaikramer/keystore-explorer
jpDaysOfMonth.setFocusable(true);
jpDaysOfMonth.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent evt) {
代码示例来源:origin: org.codehaus.izpack/izpack-installer
glassPane.addFocusListener(new FocusAdapter()
代码示例来源:origin: triplea-game/triplea
rightHandSidePanel.addFocusListener(focusToMapPanelFocusListener);
smallView.addFocusListener(focusToMapPanelFocusListener);
tabsPanel.addFocusListener(focusToMapPanelFocusListener);
内容来源于网络,如有侵权,请联系作者删除!