本文整理匯總了Java中javax.swing.JPopupMenu.setBorder方法的典型用法代碼示例。如果您正苦於以下問題:Java JPopupMenu.setBorder方法的具體用法?Java JPopupMenu.setBorder怎麽用?Java JPopupMenu.setBorder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JPopupMenu
的用法示例。
在下文中一共展示了JPopupMenu.setBorder方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doSelect
import javax.swing.JPopupMenu; //導入方法依賴的package包/類
private void doSelect(JComponent owner) {
invokingComponent = owner;
invokingComponent.addMouseListener(this);
invokingComponent.addMouseMotionListener(this);
pTable.addMouseListener(this);
pTable.addMouseMotionListener(this);
pTable.getSelectionModel().addListSelectionListener( this );
displayer.getModel().addComplexListDataListener( this );
Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
popup = new JPopupMenu();
popup.setBorderPainted( false );
popup.setBorder( BorderFactory.createEmptyBorder() );
popup.add( pTable );
popup.pack();
int locationX = x - (int) pTable.getPreferredSize().getWidth();
int locationY = y + 1;
popup.setLocation( locationX, locationY );
popup.setInvoker( invokingComponent );
popup.addPopupMenuListener( this );
popup.setVisible( true );
shown = true;
invocationTime = System.currentTimeMillis();
}
示例2: doSelect
import javax.swing.JPopupMenu; //導入方法依賴的package包/類
private void doSelect(JComponent owner) {
invokingComponent = owner;
invokingComponent.addMouseListener(this);
invokingComponent.addMouseMotionListener(this);
pTable.addMouseListener(this);
pTable.addMouseMotionListener(this);
pTable.getSelectionModel().addListSelectionListener( this );
controller.getTabModel().addComplexListDataListener( this );
Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK);
popup = new JPopupMenu();
popup.setBorderPainted( false );
popup.setBorder( BorderFactory.createEmptyBorder() );
popup.add( pTable );
popup.pack();
int locationX = x - (int) pTable.getPreferredSize().getWidth();
int locationY = y + 1;
popup.setLocation( locationX, locationY );
popup.setInvoker( invokingComponent );
popup.addPopupMenuListener( this );
popup.setVisible( true );
shown = true;
invocationTime = System.currentTimeMillis();
}
示例3: show
import javax.swing.JPopupMenu; //導入方法依賴的package包/類
public void show( JComponent invoker, int x, int y ) {
JPanel panel = new JPanel();
panel.setOpaque( false );
fillContent( panel );
popup = new JPopupMenu();
popup.add( panel );
if( windowsLaF ) {
popup.setBorder( BorderFactory.createLineBorder( windowsSeparatorColor.darker() ));
}
popup.show( invoker, x, y );
}
示例4: initializePopup
import javax.swing.JPopupMenu; //導入方法依賴的package包/類
protected void initializePopup() {
popup = new JPopupMenu();
popup.setLayout(new BorderLayout());
popup.setBorder(new EmptyBorder(0, 0, 0, 0));
popup.addPopupMenuListener(this);
popup.add(scroller);
popup.pack();
}