小编Exi*_*890的帖子

从语法构建符号表

我试图通过使用eclipse 从我的语法(使用antlr完成)构建一个符号表.但是我不知道从什么开始.我想我在某处读到你需要antlr生成的解析器和词法分析器才能做到这一点.有人知道一个简单的例子,以便我能理解它是如何工作的吗?

eclipse grammar antlr symbol-table

4
推荐指数
1
解决办法
4389
查看次数

自定义JButton与nimbus

你好我试图从nimbus定制JButton,这就是我做的:

public static void main(String[] args) 
{
    // TODO Auto-generated method stub
    Font police1 = new Font("Tahoma", Font.BOLD, 12);
    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                UIManager.getLookAndFeelDefaults().put("Button.background",new Color(18,55,63));
                UIManager.getLookAndFeelDefaults().put("Button.font", police1);
                UIManager.getLookAndFeelDefaults().put("Button.textForeground", new Color(122,216,247));

                break;
            }
        }
    } catch (Exception e) {
        // If Nimbus is not available, you can set the GUI to another look    and feel.
}
Run Code Online (Sandbox Code Playgroud)

这就是我得到的:

纽扣

正如你可以看到每个按钮周围有一些灰色边框,我试图删除它或改变它的颜色,但我找不到如何:(.

一旦我按下一个,我就明白了:

按下按钮

事实上,这是一个更接近颜色的人(18,55,63).有没有办法定制正常的外观和分别按下的外观?我查了这个链接http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html但它无法帮助我.

java swing jbutton nimbus

3
推荐指数
1
解决办法
1371
查看次数

标签 统计

antlr ×1

eclipse ×1

grammar ×1

java ×1

jbutton ×1

nimbus ×1

swing ×1

symbol-table ×1