widecombobox.java
来自「WinTVCap_GUI-3.3.6-src.zip,WINCE下的源码,JAV」· Java 代码 · 共 44 行
JAVA
44 行
package wtvcgui.comp.gui;
import javax.swing.*;
import java.awt.*;
import java.util.Vector;
// got this workaround from the following bug:
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4618607
public class WideComboBox extends JComboBox{
public WideComboBox() {
}
public WideComboBox(final Object items[]){
super(items);
}
public WideComboBox(Vector items) {
super(items);
}
public WideComboBox(ComboBoxModel aModel) {
super(aModel);
}
private boolean layingOut = false;
public void doLayout(){
try{
layingOut = true;
super.doLayout();
}finally{
layingOut = false;
}
}
public Dimension getSize(){
Dimension dim = super.getSize();
if(!layingOut)
dim.width = Math.max(dim.width, getPreferredSize().width);
return dim;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?