e812. 强制弹出菜单为重组件
By default, Swing popup menus used by JMenu
and JPopupMenu
are lightweight. If heavyweight components are used in the same frame, the popup menus may appear behind the heavyweight components.
This example demonstrates how to force a JPopupMenu to use heavyweight components:
JPopupMenu popupMenu = new JPopupMenu(); // Retrieve current setting
boolean lwPopup = popupMenu.isLightWeightPopupEnabled(); // true // Force the popup menu to use heavyweight components
popupMenu.setLightWeightPopupEnabled(false);
// To use the popup menu, see e810 Creating a Popup Menu
This example demonstrates how to force the popup menu of a JMenu
to be heavyweight:
// Create a menu with a menu item
JMenu menu = new JMenu("Menu Label");
menu.add(new JMenuItem("Item Label")); // Retrieve current setting
lwPopup = menu.getPopupMenu().isLightWeightPopupEnabled(); // true // Force the menu's popup menu to be heavyweight
menu.getPopupMenu().setLightWeightPopupEnabled(false);
// To use the menu, see e808 建立菜单栏,菜单,菜单项
This example configures all popup menus to be heavyweight:
// Retrieve current setting
lwPopup = JPopupMenu.getDefaultLightWeightPopupEnabled(); // true // Globally use heavyweight components for all popup menus
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
Related Examples |
e812. 强制弹出菜单为重组件的更多相关文章
- [Flex] 组件Tree系列 —— 作为PopUpButton的弹出菜单
mxml: <?xml version="1.0" encoding="utf-8"?> <!--功能描述:Tree作为PopUpButton ...
- iOS开发——动画篇Swift篇&炫酷弹出菜单
炫酷弹出菜单 这个是一个第三方按钮菜单组件,原版是使用Objective-C编写的名为AwesomeMenu的组件,地址是:https://github.com/levey/AwesomeMenu ...
- 如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题
如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题 如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题 在android中有时候可能要实现一个底部弹 ...
- Delphi XE7实现的任意位置弹出菜单
Delphi XE7中目前还没有弹出菜单组件,这个弹出菜单应用很普遍,在JAVA开发的安卓程序中很简单就可以用上了,应该说是一个标准控件.看了一些例子,但是都不能满足我想在任意位置弹出菜单需求,于是自 ...
- Vue2的右键弹出菜单(vue-contextmenu)
给大家推荐一个基于Vue2的右键弹出菜单插件,支持单一SPA页面以及可以在循环绑定中使用. 项目地址为:https://github.com/chIIC/vue-...demo1: 父组件绑定右键事件 ...
- 向上弹出菜单jQuery插件
插件名:柯乐义英文名:Keleyijs文件名称:jquery.keleyi.js插件功能:该插件可以让你轻易地在页面上构建一个向上弹出的二级菜单. 示例查看:http://keleyi.com/kel ...
- html5手机端遮罩弹出菜单代码
效果体验:http://hovertree.com/texiao/html5/17/ 效果图: 代码如下: <!doctype html> <html lang="zh&q ...
- DIV+CSS制作二级横向弹出菜单,略简单
没有使用JavaScript控制二级菜单的显示,结果如上图所示. 代码如下: <!DOCTYPE html> <html> <head> <meta char ...
- vc++ 如何添加右键弹出菜单
一.创建新工程 二.编辑菜单资源 1.添加菜单 按"Ctrl+R",双击"Menu"图标 2.于菜单编辑器内编辑菜单 四.添加代码(红色部分) void CCM ...
随机推荐
- Multi-cloud Kubernetes with Triton
https://www.joyent.com/blog/triton-kubernetes-multicloud While running an experimental Kubernetes cl ...
- 第二章 使用接口(Using Interfaces)-书籍翻译
PDF预览 下载地址 http://files.cnblogs.com/DKSoft/CodingInDelphi.pdf 1.1. 解耦(Decoupling) All through this b ...
- 【Acm】算法之美—Jugs
题目概述:Jugs In the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted wi ...
- JMeter测试工具中的参数化使用[函数助手]
下面是我使用JMeter测试工具对某项目中的一个http接口进行测试时的配置参数,使用到了JMeter的随机函数: 在发送POST请求时,需要发送json格式的数据,其中使用到JMeter的" ...
- ADB Fix error : insufficient permissions for device
Ubuntu 15中在使用中Android开发板时,命令行下输入adb devices.adb shell会提示insufficient permissions for device. 通常重启下ad ...
- 将String转换成InputStream
String str = "";//add your string contentInputStream inputStream = new ...
- Leetcode:Scramble String 解题报告
Scramble String Given a string s1, we may represent it as a binary tree by partitioning it to two no ...
- if __name__ == '__main__' 含义
if __name__ == '__main__': app.run(host = '0.0.0.0',debug=app.config['DEBUG']) 1.是项目入口的含义2.如果是在生产环境下 ...
- shell数组应用
引言 在Linux平台上工作,我们经常需要使用shell来编写一些有用.有意义的脚本程序.有时,会经常使用shell数组.那么,shell中的数组是怎么表现的呢,又是怎么定义的呢?接下来逐一的进行讲解 ...
- [转] javaweb学习-jstl-<c:forEach>中 varStatus的属性简介
原文地址:http://blog.csdn.net/u010648555/article/details/51093277 varStatus是<c:forEach>jstl循环标签的一个 ...