當前位置: 首頁>>代碼示例>>Java>>正文


Java JPopupMenu.setBorder方法代碼示例

本文整理匯總了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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:ButtonPopupSwitcher.java

示例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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:ButtonPopupSwitcher.java

示例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 );
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:BrowserMenu.java

示例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();
}
 
開發者ID:bcgov,項目名稱:sbc-qsystem,代碼行數:9,代碼來源:JTreeComboBox.java


注:本文中的javax.swing.JPopupMenu.setBorder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。