Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Selected theme and colors of newly created SWING components
 Post subject: Selected theme and colors of newly created SWING components Post rating: 0   New post Posted: Fri 25 Oct, 2019, 00:25 

User rating: 1
Joined: Tue 24 Apr, 2012, 13:41
Posts: 36
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


 
 Post subject: Re: Selected theme and colors of newly created SWING components Post rating: 0   New post Posted: Fri 20 Dec, 2019, 16:12 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6078
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 6 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 

Jump to:  

  © 1998-2011 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com