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.

How to use GTK+ theme on Linux?
 Post subject: How to use GTK+ theme on Linux? Post rating: 0   New post Posted: Tue 07 Jan, 2014, 19:28 
User avatar

User rating: 7
Joined: Thu 05 Sep, 2013, 12:43
Posts: 56
Location: Russian Federation, Tomsk
Hello,
By default JForex platform on Linux use Nimbus Java Look And Feel.
Image

Can I change it to GTK+ Java Look And Feel?
Image

With default Nimbus Java Look And Feel there are some bugs, for example viewtopic.php?f=85&t=50406&p=76319 or viewtopic.php?p=75841#p75841

I try to uncomment line
swing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

in file /usr/lib/jvm/java-7-openjdk-i386/jre/lib/swing.properties but no result.

Kubuntu 13.10


Attachments:
GettingAndSettingLAF.java [1.73 KiB]
Downloaded 170 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.
 
 Post subject: Re: How to use GTK+ theme on Linux? Post rating: 1   New post Posted: Wed 08 Jan, 2014, 10:59 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Don't use OpenJDK. There are issues with that java implementation.
Use java from oracle.

I don't think so it will solve your issue about Look&Feel, but it worth to replace the openJdk.


 
 Post subject: Re: How to use GTK+ theme on Linux? Post rating: 2   New post Posted: Wed 08 Jan, 2014, 16:50 
User avatar

User rating: 96
Joined: Mon 09 Sep, 2013, 07:09
Posts: 287
Location: Ukraine, SHostka
Try this code:
package jforex;

import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;
import com.dukascopy.api.RequiresFullAccess;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

@RequiresFullAccess
public class SetGtkLookAndFeel implements IStrategy {

    public void onStart(IContext context) throws JFException {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception ex) {
            context.getConsole().getOut().println(ex);
        }
        SwingUtilities.updateComponentTreeUI(context.getUserInterface().getMainFrame());
        context.stop();
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {}
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
    public void onMessage(IMessage message) throws JFException {}
    public void onAccount(IAccount account) throws JFException {}
    public void onStop() throws JFException {}
}
It is not perfect but this is a way.


Attachments:
SetGtkLookAndFeel.java [1.23 KiB]
Downloaded 172 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.
 
 Post subject: Re: How to use GTK+ theme on Linux? Post rating: 0   New post Posted: Fri 10 Jan, 2014, 09:04 
User avatar

User rating: 7
Joined: Thu 05 Sep, 2013, 12:43
Posts: 56
Location: Russian Federation, Tomsk
hebasto wrote:
Try this code:
package jforex;

import com.dukascopy.api.IAccount;
import com.dukascopy.api.IBar;
import com.dukascopy.api.IContext;
import com.dukascopy.api.IMessage;
import com.dukascopy.api.IStrategy;
import com.dukascopy.api.ITick;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;
import com.dukascopy.api.RequiresFullAccess;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

@RequiresFullAccess
public class SetGtkLookAndFeel implements IStrategy {

    public void onStart(IContext context) throws JFException {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception ex) {
            context.getConsole().getOut().println(ex);
        }
        SwingUtilities.updateComponentTreeUI(context.getUserInterface().getMainFrame());
        context.stop();
    }

    public void onTick(Instrument instrument, ITick tick) throws JFException {}
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {}
    public void onMessage(IMessage message) throws JFException {}
    public void onAccount(IAccount account) throws JFException {}
    public void onStop() throws JFException {}
}
It is not perfect but this is a way.


Thanks but it is not good idea. I try this code but there are many bugs in grafical interface of JForex platform.


 

Jump to:  

  © 1998-2025 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