本文整理了Java中javax.swing.JPopupMenu.setLightWeightPopupEnabled()
方法的一些代码示例,展示了JPopupMenu.setLightWeightPopupEnabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPopupMenu.setLightWeightPopupEnabled()
方法的具体详情如下:
包路径:javax.swing.JPopupMenu
类名称:JPopupMenu
方法名:setLightWeightPopupEnabled
暂无
代码示例来源:origin: net.sourceforge.mydoggy/mydoggy-plaf
protected void initPopupMenu() {
if (popupMenu == null) {
popupMenu = new JPopupMenu("ToolWindowBarContainerPopupMenu");
popupMenu.setLightWeightPopupEnabled(false);
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf
protected JMenu createSystemMenu() {
JMenu menu = new JMenu(" ");
menu.getPopupMenu().setLightWeightPopupEnabled(false);
return menu;
}
};
代码示例来源:origin: stackoverflow.com
final JPopupMenu popup = new JPopupMenu();
popup.setLightWeightPopupEnabled(false);
popup.setInvoker(myJFrame);
代码示例来源:origin: com.github.cfparser/cfml.parsing
private void createTree() {
tree = new JTree(new DefaultMutableTreeNode("Choose a java source file."));
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
popup = new JPopupMenu();
JMenuItem mi = new JMenuItem("Expand all children");
mi.addActionListener(this);
mi.setActionCommand("expand");
popup.add(mi);
mi = new JMenuItem("Collapse all children");
mi.addActionListener(this);
mi.setActionCommand("collapse");
popup.add(mi);
popup.setOpaque(true);
popup.setLightWeightPopupEnabled(true);
tree.addMouseListener(this);
}
代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-extra
public PopupMenuResizer(JPopupMenu menu) {
this.menu = menu;
this.menu.setLightWeightPopupEnabled(true);
menu.addMouseListener(this);
menu.addMouseMotionListener(this);
}
代码示例来源:origin: eugener/oxbow
private PopupMenuResizer( JPopupMenu menu ) {
this.menu = menu;
this.menu.setLightWeightPopupEnabled(true);
menu.addMouseListener(this);
menu.addMouseMotionListener(this);
}
代码示例来源:origin: org.bidib.org.oxbow/swingbits
private PopupMenuResizer( JPopupMenu menu ) {
this.menu = menu;
this.menu.setLightWeightPopupEnabled(true);
menu.addMouseListener(this);
menu.addMouseMotionListener(this);
}
代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets
public PopupMenuResizer(JPopupMenu menu) {
this.menu = menu;
this.menu.setLightWeightPopupEnabled(true);
menu.addMouseListener(this);
menu.addMouseMotionListener(this);
}
代码示例来源:origin: stackoverflow.com
import java.awt.Window;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
public class TranslucentPopup extends JPopupMenu {
{
// need to disable that to work
setLightWeightPopupEnabled(false);
}
@Override
public void setVisible(boolean visible) {
if (visible == isVisible())
return;
super.setVisible(visible);
if (visible) {
// attempt to set tranparency
try {
Window w = SwingUtilities.getWindowAncestor(this);
w.setOpacity(0.667F);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
代码示例来源:origin: jsettlers/settlers-remake
/**
* Create a single menu in the Menubar
*
* @param menuName
* Name of the menu
* @return JMenu
*/
private JMenu createMenu(String menuName) {
ActionMap actionMap = ((JPanel) this.getContentPane()).getActionMap();
JMenu menu = new JMenu(EditorLabels.getLabel("menu." + menuName));
// because of the open gl context
menu.getPopupMenu().setLightWeightPopupEnabled(false);
for (String menuActionName : menuconfig.getProperty("menu." + menuName, "").split(",")) {
menuActionName = menuActionName.trim();
if (menuActionName.isEmpty()) {
continue;
}
if ("---".equals(menuActionName)) {
menu.addSeparator();
} else {
final Action action = actionMap.get(menuActionName);
if (action == null) {
System.err.println("Action \"" + menuActionName + "\" not found!");
continue;
}
createMenuItemForAction(action, menuActionName, menu);
}
}
return menu;
}
代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw
public JPopupMenu getPopupMenu() {
if (popupMenu == null) {
popupMenu = new JPopupMenu();
popupMenu.setLayout(new VerticalGridLayout(0, getColumnCount()));
popupMenu.addPopupMenuListener(handler);
popupMenu.setLightWeightPopupEnabled(false);
}
return popupMenu;
}
代码示例来源:origin: stackoverflow.com
popup.add(button);
popup.setBorderPainted(false);
popup.setLightWeightPopupEnabled(false);
return popup;
代码示例来源:origin: com.projectdarkstar.example.projectsnowman/snowman-world-editor
/**
* This method actually parses the top level Tuple list and makes the
* JMenu tree.
* @param menuLists A list of Tuples describing the menu structure
*/
private void parse(List<Tuple> menuLists){
System.out.println(menuLists);
for (Tuple menuTuple : menuLists) {
JMenu menu = new JMenu(menuTuple.getKey());
menu.getPopupMenu().setLightWeightPopupEnabled(false);
add(menu);
if (menuTuple.getValue() instanceof List){ // sub menus
parseSubMenus(menu,(List<Tuple>)menuTuple.getValue());
}
}
}
代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2
createItem(popup, "Downgrade");
popup.setOpaque(true);
popup.setLightWeightPopupEnabled(true);
代码示例来源:origin: com.projectdarkstar.example.projectsnowman/snowman-world-editor
/**
* This is the recursive routine that descends the menu tree represenetd by
* nested Tuple lists.
* @param menu The parent menu of the passed in sub-list
* @param list a recursively descended sub-list of Tuples
*/
private void parseSubMenus(JMenu menu, List<Tuple> list) {
for (Tuple subMenuTuple : list){
if (subMenuTuple.getValue() instanceof List) { // is a menus
JMenu subMenu = new JMenu(subMenuTuple.getKey());
subMenu.getPopupMenu().setLightWeightPopupEnabled(false);
menu.add(subMenu);
parseSubMenus(subMenu,(List)subMenuTuple.getValue());
} else {
menu.add(new JKMenuItem(subMenuTuple.getKey(),
(String)subMenuTuple.getValue()));
}
}
}
代码示例来源:origin: stackoverflow.com
System.out.println("before visible, out of EDT ---> "
+ (bol = pop.isLightweightComponent(comb)));
pop.setLightWeightPopupEnabled(true);
pop.add(comb);
System.out.println("before visible, out of EDT ---> "
代码示例来源:origin: stackoverflow.com
jTextField2.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyReleased(java.awt.event.KeyEvent evt) {
showPopup(evt);
}
});
void showPopup(java.awt.event.KeyEvent evt) {
JPopupMenu popup = new JPopupMenu();
popup.setLightWeightPopupEnabled(false);
popup.setBorder(BorderFactory.createLineBorder(Color.black));
popup.setLayout(new BorderLayout());
popup.setSize(this.getPreferredSize());
popup.setPreferredSize(this.getPreferredSize());
popup.pack();
popup.setOpaque(false);
// create panel that contains the search result
popup.add(BorderLayout.CENTER, <YOUR PANEL WITH THE RESULT>);
popup.setPreferredSize(new Dimension(jTextField2.getWidth(),250));
<SEARCH PANEL>.setPreferredSize(new Dimension(jTextField2.getWidth(),250));
popup.show(jTextField2, 0, jTextField2.getHeight());
}
代码示例来源:origin: JDatePicker/JDatePicker
internalView.getMonthPopupMenu().setLightWeightPopupEnabled(false);
internalView.getMonthPopupMenu().show((Component) arg0.getSource(), arg0.getX(), arg0.getY());
} else if (arg0.getSource() == internalView.getTodayLabel()) {
代码示例来源:origin: tinyMediaManager/tinyMediaManager
popup.setLightWeightPopupEnabled(true);
popup.add(calendarPanel);
代码示例来源:origin: notzippy/JALOPY2-MAIN
popupMenu.setLightWeightPopupEnabled(true);
内容来源于网络,如有侵权,请联系作者删除!