📄 logicevent.java
字号:
/*
* LogicEvent.java
*
* Created on 2007年12月9日, 下午7:01
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package WordTest;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
/**
*
* @author Administrator
*/
public class LogicEvent {
// private FontTest ff;
/** Creates a new instance of LogicEvent */
public LogicEvent() {
}
public static JMenu makeMenu(Object parent,Object [] items,Object target){
JMenu m = null;
if(parent instanceof JMenu)
m = (JMenu) parent;
else if(parent instanceof String)
m = new JMenu((String) parent);
else return null;
for(int i = 0;i < items.length;i++){
if(items[i] == null)
m.addSeparator();//添加分隔线
else
m.add(makeMenuItem(items[i],target));
}
return m;
}
public static JMenuItem makeMenuItem(Object item,Object target){
JMenuItem r = null;
if(item instanceof String)
r = new JMenuItem((String) item);
else if(item instanceof JMenuItem)
r = (JMenuItem) item;
else return null;
if(target instanceof ActionListener)
r.addActionListener((ActionListener) target);
return r;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -