默认
发表评论 10
想开发IM:买成品怕坑?租第3方怕贵?找开源自已撸?尽量别走弯路了... 找站长给点建议
你可以把这段代码放到Eclipse里去执行看看,BeautyEye v3.7里解决了这个老外说的问题(你可以用v3.6对比一下,换个beautyeye的jar包就行)。
不知你描述的问题是否跟老外是一样的,你看看他的代码,或许能给你启发!


》BeautyEye的v3.7版解决的这个问题是老外提出来的,老外反馈的原话是:
The JTextField is not editable. If you remove beautyeye the field becomes editable”

》老外给出的出问题的代码如下:
public static void main(String[] s)
throws Exception 
{
BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();

final JPopupMenu popupTable = new JPopupMenu();
// find panel
JLabel findLabel = new JLabel("Filter for:");
findLabel.setPreferredSize(new Dimension(60, 20));
final JTextField findTextField = new JTextField();
findTextField.setColumns(10);

final JPanel container = new JPanel();
container.setBackground(new JMenuItem().getBackground()); // panel must have the same background with JMenuItems
container.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 0));
container.add(findLabel);
container.add(findTextField);

popupTable.add(container);

JButton button = new JButton("Action");

JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
buttonPanel.add(button);

JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(popupTable, BorderLayout.CENTER);
panel.add(buttonPanel, BorderLayout.SOUTH);

final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(900, 800);
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(panel, BorderLayout.CENTER);
frame.setVisible(true);

button.addActionListener
(
    new ActionListener()
    {
        public void actionPerformed(ActionEvent e)
        {
            int x = (frame.getWidth() / 2);
            int y = (frame.getHeight() / 2);

            popupTable.show(frame, x, y);
        }
    }
);
}
评论 10
老外的这个代码我调试过,可以执行的,你放到eclipse里去试试,或许能给你启发!
引用:zjj7188 发表于 2016-04-19 16:51
嗯,我用的是beautyeye-3.7,我直接把上面的代码复制过来运行了下,还是不能编辑的,把
org.jb2011.lnf. ...

我确信我当时测过上面给你的代码里是可以编辑的。

你或许更新一下JDK试试?排除一下JDK的原因。我用的JDK是1.6.18
引用:zjj7188 发表于 2016-04-19 17:51
我的jdk是jdk1.8.0_45
你的测试的时候源码 org.jb2011.lnf.beautyeye.ch7_popup.TranslucentPopupFactor ...

我靠,我提交的代码忘了设成true了,v3.7里应该是要被设置成true的!
[已解决] JPopupMenu还是不能实现文本组件可编辑_be.png

点评

JackJiang  说:
github和osc git里的v3.7已经重新更新了!  (8 年前)
打赏楼主 ×
使用微信打赏! 使用支付宝打赏!

返回顶部