order popup is now in the right position

This commit is contained in:
7u83 2017-04-07 23:37:36 +02:00
parent 4a68336f5a
commit 35e2160635
2 changed files with 10 additions and 11 deletions

View File

@ -55,12 +55,12 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="1" pref="400" max="32767" attributes="0"/> <Component id="jScrollPane1" alignment="1" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" alignment="0" pref="221" max="32767" attributes="0"/> <Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>

View File

@ -90,6 +90,7 @@ public class OpenOrdersList extends javax.swing.JPanel {
model.setRowCount(0); model.setRowCount(0);
table.setFillsViewportHeight(true); table.setFillsViewportHeight(true);
updateModel(); updateModel();
} }
public void initOrderList(Account account) { public void initOrderList(Account account) {
@ -179,11 +180,11 @@ public class OpenOrdersList extends javax.swing.JPanel {
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE) .addComponent(jScrollPane1)
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
@ -191,11 +192,11 @@ public class OpenOrdersList extends javax.swing.JPanel {
Point point = evt.getPoint(); Point point = evt.getPoint();
int currentRow = table.rowAtPoint(point); int currentRow = table.rowAtPoint(point);
if (currentRow == -1) { if (currentRow != -1) {
} else {
table.setRowSelectionInterval(currentRow, currentRow); table.setRowSelectionInterval(currentRow, currentRow);
} else {
} }
int nbuttons = MouseInfo.getNumberOfButtons(); int nbuttons = MouseInfo.getNumberOfButtons();
@ -204,9 +205,7 @@ public class OpenOrdersList extends javax.swing.JPanel {
return; return;
} }
this.ctxMenu.show(this, evt.getX(), evt.getY()); ctxMenu.show(table, point.x,point.y);
System.out.printf("Button %d %d \n", nbuttons, button);
}//GEN-LAST:event_tableMousePressed }//GEN-LAST:event_tableMousePressed