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.

Need HELP from Java Developer please!
 Post subject: Need HELP from Java Developer please! Post rating: 0   New post Posted: Sun 24 Aug, 2014, 17:51 

User rating: 0
Joined: Sun 24 Aug, 2014, 17:44
Posts: 3
Location: Tunisia, Tunis
Hi everybody,
I'm creating a custom trading platform based on the Jforex API and I need help.
My problem is that I have a ComboBox where I put all the crosses (EUR/USD, USD/CHF...), and when choosing another cross (USD/CHF for example) the loaded chart is the wrong one (GBP/USD for my case).
I don't know if there's a problem with my feedDescriptor or another thing... Do a I have to handle this with the ChartController or the ChartPresentationManager?

I'll be glad to hear your suggestions.
Thank you very much !


 
 Post subject: Re: Need HELP from Java Developer please! Post rating: 2   New post Posted: Tue 26 Aug, 2014, 21:29 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

There are some examples can be found on the wiki about how to do this and that in the ITesterClient interface.
For example the GUIModeChartTypes.java contains a way to implement a ComboBox based instrument switch.

If you have already seen these examples, and still have some issue, I suggest to show us your code, so we can assists further.

Good luck.


 
 Post subject: Re: Need HELP from Java Developer please! Post rating: 0   New post Posted: Wed 27 Aug, 2014, 11:47 

User rating: 0
Joined: Sun 24 Aug, 2014, 17:44
Posts: 3
Location: Tunisia, Tunis
Hi and thank you for your reply.
I already checked the GUIModeChartTypes.java and i haven't figured it out yet.
I created a ComboBox and here is the ItemListener code (that's where my problem is located I think)

jCrossComboBox = new JComboBox<Instrument>();
        for(int i=0;i<instArr.length;i++){
        jCrossComboBox.addItem(instArr[i]);
        }
       
        jCrossComboBox.addItemListener(new ItemListener() {
         
         @SuppressWarnings("deprecation")
         @Override
         public void itemStateChanged(ItemEvent e) {
             if (e.getStateChange() == ItemEvent.SELECTED) {
            Instrument instrument = (Instrument) jCrossComboBox.getSelectedItem();
            System.out.println("Instrument choisi" + instrument);
              IChart chart = chartPanels.keySet().iterator().next();
              System.out.println(chart.toString());
            IFeedDescriptor feedDescriptor = chart.getFeedDescriptor();
            System.out.println("Le Feed est " + feedDescriptor.toString());
            feedDescriptor.setInstrument(instrument);
            
            getChartController().setFeedDescriptor(feedDescriptor);
            
             }
         }
      });


 
 Post subject: Re: Need HELP from Java Developer please! Post rating: 0   New post Posted: Tue 02 Sep, 2014, 15:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please provide a full example program which demonstrates the problem.


 

Jump to:  

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