Solved

live data calculable into the TextField

Posted on 2011-02-23
39
408 Views
Last Modified: 2012-05-11
Please advice how to bring into TextField data from steam and order it to be variable. So I can use it in calculations.
Let's say:
if (message instanceof MarketDataSnapshot) {

            incomingQuote = (MarketDataSnapshot)message;

            symbol = incomingQuote.getInstrument().getSymbol();


            try {

                if ("EUR/USD".equalsIgnoreCase(symbol.trim())) {

                    //                    System.out.println("=>");
                    //                    System.out.println("PMDS [0]   " + message);

Open in new window

PMDS [0]   MarketDataSnapshot{QuoteID='Q-EU0094524-EURUSD-118374224',
Instrument={1,EUR/USD},
Time=20:30:34, 
Date=20110223, 

mMDEntryID='1-0-0', 
mMDEntryPx=1.37468, 
mMDEntrySize=0.0,

Open in new window

so, as soon will be come new value, it will be updated in this TextField.
bidPx = (value into TextField) will be changed with every new incoming value.
0
Comment
Question by:gbcbr
  • 21
  • 10
  • 8
39 Comments
 
LVL 92

Expert Comment

by:objects
ID: 34965040
not sure I follow the question

to get the value in a text field use the getText() method

String var = textfield.getText();

to set it use the setText() method

textfield.setText(var);
0
 

Author Comment

by:gbcbr
ID: 34965111
we have two tasks here:
1. extract value from this message. I still not sure how to do in properly. But, let's say
var= getMDEntryPx; and after send this value  into this TextField,
2. so as soon it will come into  this field in will be already variable, so I can make any operations with it.
0
 

Author Comment

by:gbcbr
ID: 34965145
The main question is to compare this value with manually entered values into other TextFields.
0
 
LVL 92

Expert Comment

by:objects
ID: 34965198
you can just use the setText() method to change the value in the text field
0
 

Author Comment

by:gbcbr
ID: 34965426
please advise practical solution:
if (message instanceof MarketDataSnapshot) {

            incomingQuote = (MarketDataSnapshot)message;
            symbol = incomingQuote.getInstrument().getSymbol();
            bidPx = incomingQuote.getBidOpen();
            askPx = incomingQuote.getAskOpen();


            try {

                if ("EUR/USD".equalsIgnoreCase(symbol.trim())) {
                               bidPx.??????
                               askPx.??????

Open in new window

public class DecisionCenterControl extends JFrame {
...............
    public DecisionCenterControl() {
        try {
            jbInit();
            this.mFxcmGateway = DBFXConnect.getGateway();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
.......................
        jLabel11.setText("BID");
        jLabel11.setBounds(new Rectangle(540, 15, 30, 25));
        jLabel11.setFont(new Font("Lucida Grande", 1, 14));
        
        jLabel12.setText("ASK");
        jLabel12.setBounds(new Rectangle(650, 15, 30, 25));
        jLabel12.setFont(new Font("Lucida Grande", 1, 14));

        jTextField1.setBounds(new Rectangle(505, 40, 95, 40));
        
        jTextField2.setBounds(new Rectangle(620, 40, 95, 40));

Open in new window

0
 
LVL 92

Expert Comment

by:objects
ID: 34965521
how are the 2 classes connected?
0
 

Author Comment

by:gbcbr
ID: 34965549
good question, I'm also want to know this.
At the moment they are not connected.
0
 
LVL 92

Expert Comment

by:objects
ID: 34965775
you DecisionCenterControl needs a reference to your business model to be able to access the value
0
 

Author Comment

by:gbcbr
ID: 34965805
this is small problem, because PMDS class initialized and got data from DBFXConnect class, how I get access to it and get bidPx value without creating new instance of PMDS class?
0
 
LVL 92

Expert Comment

by:objects
ID: 34965833
generally you would give your gui a reference to t when you startup your app

PMD5 pmd5 = .....


DecisionCenterControl dcc = .....
dcc.setPMD(pmd5);
0
 

Author Comment

by:gbcbr
ID: 34965895
I'm initiate PMDS at DBFXConnect class
public void startUp(String[] args) {

        mFxcmGateway.registerGenericMessageListener(new IGenericMessageListener() {

                public void messageArrived(ITransportable message) {

                    if (message instanceof MarketDataSnapshot) {

                        incomingQuote = (MarketDataSnapshot)message;

                        try {
                            pmds = new PMDS();
                            pmds.parseMarketDataSnapshot(message,
                                                         printMarketData);
                        } catch (Exception ex) {
                            Logger.getLogger(DBFXConnect.class.getName()).log(Level.SEVERE,
                                                                              null,
                                                                              ex);
                        }

Open in new window

but DecisionCenterControl I initiate from Main class
private static DecisionCenterControl businessLogicControl;

    public static void control() throws Exception {

        businessLogicControl = new DecisionCenterControl();
        businessLogicControl.setVisible(true);
        System.out.println("          switch on the control");
        System.out.println("=>");

    }

Open in new window

because it has some other other functions.
For me it's biggest question how to send updatable values from PMDS to DecisionCenterControl without creating new instances
0
 
LVL 92

Expert Comment

by:objects
ID: 34965993
so you create a new pmds everytime a MarketDataSnapshot message arrives. How does your gui know which one to use?
0
 

Author Comment

by:gbcbr
ID: 34966159
ok, I just temporarily make it
pmds = new PMDS();
pmds.parseMarketDataSnapshot(message, printMarketData);
now change it
 
public DBFXConnect() throws ClassNotFoundException {
        pmds = new PMDS();
    }

    public void startUp(String[] args) {

        mFxcmGateway.registerGenericMessageListener(new IGenericMessageListener() {

                public void messageArrived(ITransportable message) {

                    if (message instanceof MarketDataSnapshot) {

                        incomingQuote = (MarketDataSnapshot)message;

                        try {

                            pmds.parseMarketDataSnapshot(message,
                                                         printMarketData);
                        } catch (Exception ex) {
                            Logger.getLogger(DBFXConnect.class.getName()).log(Level.SEVERE,
                                                                              null,
                                                                              ex);
                        }

Open in new window

But it doesn't gave me any idea how to connect these classes without creating new instances.
0
 
LVL 92

Expert Comment

by:objects
ID: 34966239
you would be better off creating it in main, then you can use:


PMD5 pmd5 = .....


DecisionCenterControl dcc = .....
dcc.setPMD(pmd5);
0
 

Author Comment

by:gbcbr
ID: 34967926
Sorry, I lost logic.
How I can set PMDS into dcc?
I create now PMDS into the main
public static void main(String[] args) throws Exception {

        callSelect();
        control();
        console();
        data();

        startup = new DBFXConnect();
        startup.startUp(args);
    }

    private static Timer timer;

    /**
     * @throws Exception
     */
    public static void callSelect() throws Exception {
        try {
            timer = new Timer();
            timer.schedule(new SelectData(), 10000, 1000);
            System.out.println("          switch on the Timer");
            System.out.println("=>");

        } catch (Exception ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }

    }

    private static DecisionCenterControl dcc;

    public static void control() throws Exception {

        dcc = new DecisionCenterControl();

        dcc.setVisible(true);
        System.out.println("          switch on the control");
        System.out.println("=>");

    }

    private static ConsoleFrame consoleFrame;

    public static void console() {
        consoleFrame = new ConsoleFrame();
        consoleFrame.setVisible(true);
        System.out.println("          switch on the console");
        System.out.println("=>");

    }

    private static PMDS pmds;

    public static void data() throws ClassNotFoundException {
      
      pmds = new PMDS();
    }
}

Open in new window

send there data  
if (message instanceof MarketDataSnapshot) {

                        incomingQuote = (MarketDataSnapshot)message;

                        try {

                            pmds.parseMarketDataSnapshot(message,
                                                         printMarketData);
                        } catch (Exception ex) {
                            Logger.getLogger(DBFXConnect.class.getName()).log(Level.SEVERE,
                                                                              null,
                                                                              ex);
                        }

Open in new window

now I need to set bidPX to jTextField1 ......
0
 
LVL 92

Expert Comment

by:objects
ID: 34968014
public static void main(String[] args) throws Exception {

        callSelect();
        data();
        control();
        console();

        startup = new DBFXConnect();
        startup.startUp(args);
    }


    public static void control() throws Exception {

        dcc = new DecisionCenterControl();
        dcc.setPMDS(pmds);    // <--- you'll need to add setPMDS() method to DecisionCenterControl
     }
0
 

Author Comment

by:gbcbr
ID: 34968537
>> // <--- you'll need to add setPMDS() method to DecisionCenterControl
 
public void  setPMDS() {    
    }

Open in new window

But how to set value bidPx
if ("EUR/USD".equalsIgnoreCase(symbol.trim())) {
                               bidPx.????

Open in new window

to  
jTextField1.setBounds(new Rectangle(505, 40, 95, 40));

Open in new window

0
 

Author Comment

by:gbcbr
ID: 34968620
I make it like this  
public void pMDS(ITransportable message, boolean printMarketData) throws SQLException,
                                                                        ClassNotFoundException,
                                                                        InstantiationException,
                                                                        IllegalAccessException,
                                                                        FieldNotFound,
                                                                        Exception {

        if (message instanceof MarketDataSnapshot) {

            incomingQuote = (MarketDataSnapshot)message;
            symbol = incomingQuote.getInstrument().getSymbol();
            bidPx = incomingQuote.getBidOpen();
            askPx = incomingQuote.getAskOpen();

            try {

                if ("EUR/USD".equalsIgnoreCase(symbol.trim())) {
                              eurusd_bid = bidPx;

Open in new window

jTextField1.setBounds(new Rectangle(505, 40, 95, 40));
        jTextField1.setText(pmds.pMDS(message, printMarketData).eurusd_bid);

Open in new window


but it generate error:
Operation not allowed on void;
Type or field "eurusd_bid" not found in "DecisionCenterControl";
0
 

Author Comment

by:gbcbr
ID: 34968662
maybe problem that "eurusd_bid" should be String, not a double and I need to convert it into the string?
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:gbcbr
ID: 34969336
I change setPMDS to return
public static PMDS setPMDS (){
      return pmds;
    }

Open in new window

but what is next?
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34970340
As a side note...if you're working with financial data, you should be using BigDecimal instead of double or float, and definitely instead of String.  It gives you control over the rounding and guarantees precision for the numbers you are working with.

That set method is incorrect.  It is getting a PMDS instance, not setting one.  If you only have one of those for the entire application you could make it a singleton class; something like:

 
public class PMDS {
    private static final PMDS INSTANCE = new PMDS();
    public static PMDS getInstance() {
        return INSTANCE;
    }

    // constructor private so only PMDS can create itself
    private PMDS() {
        // build object
    }

    // other object code...
}

Open in new window


Then, when you receive an update for the object, you can set the reference to it.  If the class that receives the update also has access to your TextField, you can set the value there.  If not, you may want to use the PropertyChangeListener interface to register listeners with your PMDS object so it can tell them when the bidPx property changes.  Your GUI can listen for that event and set the text in the TextField with the new value.  Take a look at String.format(), it should help you display the information you want.
0
 

Author Comment

by:gbcbr
ID: 34970802
>>If not, you may want to use the PropertyChangeListener interface to register listeners with your PMDS object so it can tell them when the bidPx property changes.
I make reference like this
 
if ("EUR/USD".equalsIgnoreCase(symbol.trim())) {
                    bid = bidPx;
                    eurusd_bid = String.valueOf(bid);
                    dcc.jTextField1(b);

Open in new window

and try to send it to dcc
jTextField1.setBounds(new Rectangle(505, 40, 95, 40));
        jTextField1.addActionListener(new ActionListener() {
            public void eurUSD_bid(){
                try {
                    jTextField1(b);
//              jTextField1.setText(eurusd_bid);
            } catch (Exception f) {
                        f.printStackTrace();   
    }
        }
                public void actionPerformed(ActionEvent actionEvent) {
                }
            });
.............
    public void jTextField1(String b) throws Exception {

        jTextField1.setText(eurusd_bid);
    }

Open in new window

but it generate NPE at >> dcc.jTextField1(b);
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34970833
sounds like you're not initializing a reference to dcc in your PMDS object
0
 

Author Comment

by:gbcbr
ID: 34970877
maybe I need also create instance DecisionCenterControl like PMDS and make DecisionCenterControl.getInstance from PMDS?
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34971356
If there is only one logical DecisionCenterControl in your application, then yes, that's fine.  Put the INSTANCE/getInstance() methods in the DecisionCenterControl class though, not your PMDS class.  Then, in your PMDS class, instead of calling dcc.jTextField1() you would do:

DecisionCenterControl.getInstance().jTextField1(text);
0
 

Author Comment

by:gbcbr
ID: 34971634
Now it works but still not print into textfield
if ("EUR/USD".equalsIgnoreCase(symbol.trim())) {
                    bid = bidPx;
                    eurusd_bid = String.valueOf(bid);
                    DecisionCenterControl.getInstance().eurUSD_bid_TextField(eurusd_bid);
                                      
                    System.out.println("   EUR/USD  string bid   " + eurusd_bid);

Open in new window

only into terminal window
EUR/USD  string bid   1.37988
EUR/USD  string bid   1.37991
EUR/USD  string bid   1.37994

Open in new window

jTextField1.setBounds(new Rectangle(505, 40, 95, 40));
        jTextField1.addActionListener(new ActionListener() {
            public void eurUSD_bid(){
                try {
                    eurUSD_bid_TextField(eurusd_bid);
            } catch (Exception f) {
                        f.printStackTrace();   
    }
        }
                public void actionPerformed(ActionEvent actionEvent) {
                }
            });
......................

    public void eurUSD_bid_TextField(String eurusd_bid) throws Exception {

        jTextField1.setText(eurusd_bid);
    }

Open in new window

0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34972354
Is the text field in the DCC the same as the one that is loaded in the GUI?
0
 

Author Comment

by:gbcbr
ID: 34972409
DCC is the GUI.
public class DecisionCenterControl extends JFrame {
    
  private static final DecisionCenterControl INSTANCE = new DecisionCenterControl();

  public static DecisionCenterControl getInstance() {
      return INSTANCE;
  }

    private JButton jButton1 = new JButton();
    transient IGateway mFxcmGateway;
..................
    private JTextField jTextField1 = new JTextField();
    private JTextField jTextField2 = new JTextField();
    private JTextField jTextField3 = new JTextField();
    private JTextField jTextField4 = new JTextField();
    private JTextField jTextField5 = new JTextField();
    
    private JLabel jLabel11 = new JLabel();
    private JLabel jLabel12 = new JLabel();

    private static  PMDS pmds;
    String eurusd_bid;

    public DecisionCenterControl() {
        try {
            jbInit();
            this.mFxcmGateway = DBFXConnect.getGateway();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void jbInit() throws Exception {

        this.getContentPane().setLayout(null);
        this.setSize(new Dimension(1490, 759));
        this.setAlwaysOnTop(true);
        this.setLocation(1900, 100);
        this.setTitle("DecisionCenter 60 Control Panel");
        this.setBackground(new Color(247, 247, 247));
...............
        jLabel11.setText("BID");
        jLabel11.setBounds(new Rectangle(540, 15, 30, 25));
        jLabel11.setFont(new Font("Lucida Grande", 1, 14));

        jLabel12.setText("ASK");
        jLabel12.setBounds(new Rectangle(650, 15, 30, 25));
        jLabel12.setFont(new Font("Lucida Grande", 1, 14));

        jTextField1.setBounds(new Rectangle(505, 40, 95, 40));
        jTextField1.addActionListener(new ActionListener() {
            public void eurUSD_bid(){
                try {
                    eurUSD_bid_TextField(eurusd_bid);
            } catch (Exception f) {
                        f.printStackTrace();   
    }
        }
                public void actionPerformed(ActionEvent actionEvent) {
                }
            });
............
    public void eurUSD_bid_TextField(String eurusd_bid) throws Exception {

        jTextField1.setText(eurusd_bid);
    }

Open in new window

0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34972455
Make your constructor private so the only way to access the class is by calling getInstance().  It also doesn't look like you need a reference to the PMDS object from the DCC, rather the other way around so you can remove that static variable.

I think what is happening is your main() method is creating one instance of the DCC, which is shown to the user, but your PMDS class uses the getInstance() method, which is a separate instance of the class.  If you change the constructor to private and modify your main() method so it uses
DCC.getInstance()

Open in new window

instead of
new DCC()

Open in new window

I think the updates will work.
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34972492
Also, not sure what the intent of your text field is.  Is it to display the current value received by PMDS or is it for the user to enter a value, or both?

Your anonymous ActionListener should move the eurUSD_bid() code into the actionPerformed method, otherwise that code will never be called.  Also, it seems that the listener will just call the method that sets the text on the same text field that triggered the event, effectively doing nothing but wasting CPU cycles.  Not sure if that's truly what you intended.
0
 

Author Comment

by:gbcbr
ID: 34972597
In general, my intention in this case is to control deals by comparing fields.
This field which I try to get value from market is dynamic, another one is static and it has to be entered manually. This is the border point. I have to see distance from rate to this border point and as soon it will reach it one of directions of deals (SELL or BUY) will be blocked.
Now I'm doing this manually by pressing ToggleButtons when I see that rate comes to the border, this is the reason why this class called DecisionControlCenter, because it controls bot.
0
 
LVL 10

Accepted Solution

by:
gordon_vt02 earned 500 total points
ID: 34972923
Ok.  I'd recommend moving the logic for the DCC into its own class.  That class will need to know about the value entered in the GUI and the values received from the PMDS object.  It should contain the business logic to determine what the border points are and be able to notify the GUI when those conditions change.

// singleton class, should only be one
public class DecisionModel {
    public static enum Operation { BUY, SELL; }

    private static final DecisionModel INSTANCE = new DecisionModel();
    public static DecisionModel getInstance() {
        return INSTANCE;
    }

    // user provided value
    private BigDecimal userBidPx;
    // PMDS value
    private BigDecimal pmdsBidPx;
    // currently allowed operations
    private Set<Operation> availableOperations;

    // PropertyChangeSupport object to handle property change
    // notifications
    private final PropertyChangeSupport propertyChangeSupport;

    // private to enforce singleton access through getInstance()
    private DecisionModel() {
        // perform initialization for bid values and op-set,
        // below is a sample

        // use string constructors to guarantee precision
        userBidPx = new BigDecimal("0.0");
        pmdsBidPx = new BigDecimal("0.0");
        availableOperations = Collections.EMPTY_SET;

        // configure property change support
        propertyChangeSupport = new PropertyChangeSupport();
    }

    // add a listener that listens for changes to a single property
    public void addPropertyChangeListener(String propertyName, PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(propertyName, l);
    }

    // remove a listener that listens for changes to a single property
    public void removePropertyChangeListener(String propertyName, PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(propertyName, l);
    }

    // add a listener that listens for changes to all properties
    public void addPropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(l);
    }

    // remove a listener that listens for changes to all properties
    public void removePropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(l);
    }

    public void setUserBidPx(BigDecimal userBidPx) {
        if (!this.userBidPx.equals(userBidPx)) {
            BigDecimal old = this.userBidPx;
            this.userBidPx = userBidPx;
            propertyChangeSupport.firePropertyChange("userBidPx", old, this.userBidPx);
            checkBorderConditions();
        }
    }

    public BigDecimal getUserBidPx() { return userBidPx; }

    public void setPmdsBidPx(BigDecimal pmdsBidPx) {
        if (!this.pmdsBidPx.equals(pmdsBidPx)) {
            BigDecimal old = this.pmdsBidPx;
            this.pmdsBidPx = pmdsBidPx;
            propertyChangeSupport.firePropertyChange("pmdsBidPx", old, this.pmdsBidPx);
            checkBorderConditions();
        }
    }

    public BigDecimal getPmdsBidPx() { return pmdsBidPx; }

    private void setAvailableOperations(Set<Operation> ops) {
        if (!availableOperations.equals(ops)) {
            Set<Operation> old = availableOperations;
            availableOperations = ops;
            propertyChangeSupport.firePropertyChanged("availableOperations", old, availableOperations);
        }
    }

    private void checkBorderConditions() {
        // determine available operations
        if (buyAllowed) {
            if (sellAllowed) {
                setAvailableOperations(EnumSet.of(Operation.BUY, Operation.SELL));
            } else {
                setAvailableOperations(EnumSet.of(Operation.BUY));
            }
        } else if (sellAllowed) {
            setAvailableOperations(EnumSet.of(Operation.SELL));
        } else {
            setAvailableOperations(Collections.EMPTY_SET);
        }
    }
}

Open in new window


If you use the DecisionModel object, make sure you read the docs for PropertyChangeSupport so you understand what each call is doing.

Your GUI would have to recognize when a new value was provided in the text field by the user.  You can use the actionPerformed event to identify that value, then call DecisionModel.setUserBidPx() to update the value.  The same goes for the PMDS object.  When it gets a new value, it calls DecisionModel.setPmdsBidPx().  Both of these methods will trigger a PropertyChangedEvent if the value has changed and then they will check the border conditions, updating the set of allowable operations.

Your GUI would need to add a PropertyChangeListener to the DecisionModel class for both the "pmdsBidPx" and "availableOperations" properties.  In the propertyChanged() method of the "pmdsBidPx" listener, you can update the text field with the new PMDS value.  In the "availableOperations" listener's method, you could change the state of the Buy and Sell buttons based on the operations contained in the set:

buyButton.setEnabled(opSet.contains(DecisionModel.Operation.BUY));
sellButton.setEnabled(opSet.contains(DecisionModel.Operation.SELL));

Open in new window


When you first create your GUI, you can initialize it based on the default values in the DecisionModel.

Hope that helps some!
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34972963
As I mentioned earlier, you want to use BigDecimals instead of doubles for financial data to prevent loss of precision and to give you control over rounding, which may be required -- especially in the financial sector, which is why the DecisionModel class only contains BigDecimal objects.  BigDecimal is immutable (like String) so all operations on it return a new BigDecimal object.  Your subtraction would look something like this:

BigDecimal bd1; // some BigDecimal
BigDecimal bd2; // some other BigDecimal
BigDecimal result = bd1.subtract(bd2); // creates a new BigDecimal, leaving bd1 and bd2 unmodified

Open in new window

0
 

Author Comment

by:gbcbr
ID: 34973048
Thank you for the code, I'll study it tomorrow, today is too late. Thanks again.
0
 

Author Comment

by:gbcbr
ID: 34987153
I start study your code and create new class with it, but when I compile it generate error message
/Users/gbcbr/NetBeansProjects/StopLimitTradeStationEURUSDCHF60/StopLimitTradeStation/src/control/DecisionModel.java:48: cannot find symbol
symbol  : constructor PropertyChangeSupport()
location: class java.beans.PropertyChangeSupport
        propertyChangeSupport = new PropertyChangeSupport();
/Users/gbcbr/NetBeansProjects/StopLimitTradeStationEURUSDCHF60/StopLimitTradeStation/src/control/DecisionModel.java:97: cannot find symbol
symbol  : method firePropertyChanged(java.lang.String,java.util.Set<control.DecisionModel.Operation>,java.util.Set<control.DecisionModel.Operation>)
location: class java.beans.PropertyChangeSupport
            propertyChangeSupport.firePropertyChanged("availableOperations", old, availableOperations);
/Users/gbcbr/NetBeansProjects/StopLimitTradeStationEURUSDCHF60/StopLimitTradeStation/src/control/DecisionModel.java:103: cannot find symbol
symbol  : variable buyAllowed
location: class control.DecisionModel
        if (buyAllowed) {
/Users/gbcbr/NetBeansProjects/StopLimitTradeStationEURUSDCHF60/StopLimitTradeStation/src/control/DecisionModel.java:104: cannot find symbol
symbol  : variable sellAllowed
location: class control.DecisionModel
            if (sellAllowed) {
/Users/gbcbr/NetBeansProjects/StopLimitTradeStationEURUSDCHF60/StopLimitTradeStation/src/control/DecisionModel.java:109: cannot find symbol
symbol  : variable sellAllowed
location: class control.DecisionModel
        } else if (sellAllowed) {
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors

Open in new window

Please advice.
For boolean buyAllowed and sellAllowed - where you suggest to initialize them?
Why in can't find Error(48,33):  cannot find constructor PropertyChangeSupport() and
Error(97,34):  cannot find method firePropertyChanged(java.lang.String,java.util.Set<control.DecisionModel.Operation>,java.util.Set<control.DecisionModel.Operation>)
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34991815
Sorry, the PropertyChangeSupport class only has 1 constructor.  Pass your object (this) to the constructor.  Read the API docs for PropertyChangeSupport so you know what it does.
0
 

Author Comment

by:gbcbr
ID: 34991819
OK
0
 

Author Closing Comment

by:gbcbr
ID: 34992603
Thank you for the good idea.
0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 34992719
Glad its working out for you.  Good luck!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now