Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Selected theme and colors of newly created SWING components
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=57183
Page 1 of 1

Author:  fxer [ Fri 25 Oct, 2019, 00:25 ]
Post subject:  Selected theme and colors of newly created SWING components

Hello,

In my strategy I create panel with few SWING components, so I do something like this:
public void onStart(final IContext context) throws JFException {
    this.context = context;

    final JPanel panelMain = context.getUserInterface().getBottomTab(tabName);
    panelMain.setLayout(new GridBagLayout());

    GridBagConstraints c = new GridBagConstraints();
    c.ipadx = 2; c.ipady = 2; c.insets = new Insets(2, 2, 2, 2);
    c.fill = GridBagConstraints.BOTH;

    btnRefresh = new JButton("Refresh");
    c.gridx = 1; c.gridy = 1; panelMain.add(btnRefresh, c);
}

Unfortunately all SWING components I add have colors from light theme. How to make them have colors from dark theme?

Regards,
FXer

Author:  API Support [ Fri 20 Dec, 2019, 16:12 ]
Post subject:  Re: Selected theme and colors of newly created SWING components

Hello.

UI components with platform themes support are available in plugins through UIFactory interface
https://www.dukascopy.com/client/javado ... ctory.html
See attached example.

Kind regards, Support Team.

Attachments:
MyPlugin.java [1.01 KiB]
Downloaded 120 times

  Page 1 of 1