我所希望的,在编辑打字的时候的JComboBox,在弹出菜单中的JComboBox中以autumaticaly出现,我这样做,它的工作.但是,当我改变了图标的的箭头按钮在JCombobox工作它没有任何更多的如图片所示
在更改箭头按钮图标之前

更改箭头按钮图标后(弹出窗口永远不会出现,当一个人写入时JCombobox)

这就是我做的:
JTextComponent editor;
/** Creates new form combo */
public combo() {
initComponents();
editor = (JTextComponent) jComboBox1.getEditor().getEditorComponent();
jComboBox1.setEditable(true);
editor.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
char keyChar = e.getKeyChar();
if (jComboBox1.isDisplayable())
{
jComboBox1.setPopupVisible(true);
}
editor.setCaretPosition(editor.getText().length());
// System.out.println("wwwweeeee"+keyChar);
}
});
jComboBox1.setUI(new SynthComboBoxUI() {
protected JButton createArrowButton() {
JButton btn = new JButton();
btn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/error3.png")));
return btn;
}
}); …Run Code Online (Sandbox Code Playgroud) 我正在尝试在html的div标签中播放视频但是当我使用以下代码时,浏览器询问我是否要下载视频.我不想下载它,我只想玩它.此消息也出现在div中
"您需要安装扩展程序才能查看此内容"
我正在使用firefox浏览器
这是我在html文件中使用的:
<div>
<object type="Brave/quicktime" data="Brave.avi" width="624" height="352">
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
<param name="controller" value="false" />
<param name="autoplay" value="true" />
</object>
</div>
Run Code Online (Sandbox Code Playgroud) 我正在尝试在ArrayList中使用contains方法,我在其中存储了类型Employee的对象.但是当我使用这个方法时,即使我在Employee类中实现了equals方法,它总是返回false
这是我试过的:
员工类:
public class Employee {
.
.
.
@Override
public boolean equals(Object o){
if(o instanceof Employee)
{
Employee e = (Employee) o;
return this.id==(e.id);
}
return false;
}
@Override
public int hashCode() {
int hash = 7;
hash = 79 * hash + (int) (this.id ^ (this.id >>> 32));
return hash;
}
Run Code Online (Sandbox Code Playgroud)
测试类:
public class Test {
LinkedList <Employee>list=new LinkedList <Employee>();
Employee e=new Employee();
long id=0;
e.setId(20710456);
list.add(e);
e.setId(30560432);
list.add(e);
public void Edit()
{
id=Integer.parseInt(JOptionPane.showInputDialog(null,"Enter the …Run Code Online (Sandbox Code Playgroud) 我想创建并保存我创建的文件,以便没有人可以访问它.我已经知道如何创建文件,所以我的问题是:如何在注册表中保存此文件,以便没有人可以修改或删除它?
这是创建文件:
File f = new File("C:\\test.txt");
f.mkdirs();
f.createNewFile();
Run Code Online (Sandbox Code Playgroud)
我在网上搜索,这是我在注册表中保存文件的结果 http://answers.yahoo.com/question/index?qid=20090310201348AAihqUQ