Unlimited sell order works now

This commit is contained in:
7u83
2017-02-21 00:52:34 +01:00
parent eb2b6844bd
commit 17f033df24
3 changed files with 31 additions and 21 deletions

View File

@ -91,9 +91,10 @@
<Component class="javax.swing.JComboBox" name="typeComboBox">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="2">
<StringItem index="0" value="Buy "/>
<StringItem index="1" value="Sell"/>
<StringArray count="3">
<StringItem index="0" value="Buy Limit"/>
<StringItem index="1" value="Sell Limit"/>
<StringItem index="2" value="Sell"/>
</StringArray>
</Property>
</Properties>

View File

@ -53,8 +53,8 @@ public class CreateOrderDialog extends javax.swing.JDialog {
public CreateOrderDialog(java.awt.Frame parent, boolean modal, Account account, OrderType type) {
this(parent, modal);
this.account = account;
typeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[]{"Buy ", "Sell"}));
typeList = new OrderType[]{OrderType.BUYLIMIT, OrderType.SELLLIMIT};
typeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[]{"Buy Lim", "Sell Lim", "Sell"}));
typeList = new OrderType[]{OrderType.BUYLIMIT, OrderType.SELLLIMIT, OrderType.SELL};
for (int i = 0; i < typeList.length; i++) {
if (typeList[i] == type) {
this.typeComboBox.setSelectedIndex(i);
@ -123,7 +123,7 @@ public class CreateOrderDialog extends javax.swing.JDialog {
}
});
typeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Buy ", "Sell" }));
typeComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Buy Limit", "Sell Limit", "Sell" }));
limitSpinner.setModel(new javax.swing.SpinnerNumberModel(0.0d, 0.0d, null, 0.1d));