开发者

How to create JFreeChart control with JavaBuilders?

开发者 https://www.devze.com 2023-02-27 07:21 出处:网络
How can I create a JFreeChart control in YAML, using JavaBuilder? My current form YAML follows: JFrame(name=frame, title=frame.title, size=packed, defaultCloseOperation=exitOnClose):

How can I create a JFreeChart control in YAML, using JavaBuilder?

My current form YAML follows:

JFrame(name=frame, title=frame.title, size=packed, defaultCloseOperation=exitOnClose):
    - JLabel(name=sortLabel, text=label.sorttext)
    - JComboBox(name=sortComboBox, editable=false)
    - JScrol开发者_StackOverflow社区lPane(name=listScrollpane, vScrollBar=always, hScrollBar=never):
        JList(name=batteryList)
    - JButton(name=exitButton, text=button.exit, onAction=[$confirm,cancel])
    - JPanel(name=graphPanel)
    - MigLayout: |
        [[fill]]
        []                  [grow]           [grow]
        sortLabel           sortComboBox     graphPanel
        listScrollpane+2
        exitButton

I tried both JFreeChart or ChartPanel in place of JPanel(name=graphPanel), but I keep getting this error during debugging: "JFreeChart is not a recognized alias."

I verified jcommon-1.0.16.jar and jfreechart-1.0.13.jar have been added to the project libraries (in NetBeans.)

Does anyone know where I'm going wrong?


I assume you are using javabuilders. This library seems to be related to swing development. Hence it has defined YAML aliases for all swing classes. The JFreeChart class wont have an alias as it isn't a swing class.

There is a section on extending the javabuilders engine in this PDF. The following line looks helpful

SwingJavaBuilder.getConfig().addType("CustomClassAlias",MyCustomClass.class);

Sorry I can't be more specific, but I haven't really used javabuilders before.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号