Browse files

fixed stock manager wip

  • Loading branch information...
1 parent a613637 commit 02f17c05662202277396d4fe8b24e37ad1a41ef0 @anti43 committed Jul 28, 2013
Showing with 55 additions and 24 deletions.
  1. +27 −12 src/mpv5/ui/panels/Stockmanager.form
  2. +28 −12 src/mpv5/ui/panels/Stockmanager.java
View
39 src/mpv5/ui/panels/Stockmanager.form
@@ -26,7 +26,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
- <EmptySpace min="0" pref="23" max="32767" attributes="0"/>
+ <EmptySpace min="0" pref="71" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -36,7 +36,7 @@
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
- <TitledBorder title="Stock Manager">
+ <TitledBorder title="Stockmanager ">
<ResourceString PropertyName="titleX" bundle="mpv5/ui/panels/Bundle.properties" key="Stockmanager.jPanel1.border.title" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</TitledBorder>
</Border>
@@ -49,22 +49,25 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" max="-2" attributes="0">
- <Component id="jScrollPane1" max="32767" attributes="0"/>
- <Component id="jToolBar1" max="32767" attributes="0"/>
- <Group type="102" alignment="0" attributes="0">
- <Component id="jScrollPane2" min="-2" pref="459" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="jButton2" pref="54" max="32767" attributes="0"/>
- </Group>
- <Component id="labeledTextField1" max="32767" attributes="0"/>
+ <Component id="jToolBar1" pref="539" max="32767" attributes="0"/>
+ <Component id="jLabel1" max="32767" attributes="0"/>
</Group>
- <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
+ <EmptySpace min="18" max="32767" attributes="0"/>
</Group>
+ <Group type="102" attributes="0">
+ <Component id="jScrollPane2" min="-2" pref="459" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jButton2" pref="92" max="32767" attributes="0"/>
+ </Group>
+ <Component id="labeledTextField1" alignment="0" max="32767" attributes="0"/>
+ <Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
+ <Component id="jLabel1" min="-2" pref="18" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jScrollPane2" max="32767" attributes="0"/>
<Component id="jButton2" max="32767" attributes="0"/>
@@ -75,7 +78,6 @@
<Component id="jScrollPane1" min="-2" pref="202" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jToolBar1" min="-2" max="-2" attributes="0"/>
- <EmptySpace pref="71" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -105,6 +107,11 @@
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
</Component>
+ <Component class="javax.swing.JToolBar$Separator" name="jSeparator1">
+ <Properties>
+ <Property name="name" type="java.lang.String" value="jSeparator1" noResource="true"/>
+ </Properties>
+ </Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
@@ -190,6 +197,14 @@
<Property name="name" type="java.lang.String" value="labeledTextField1" noResource="true"/>
</Properties>
</Component>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="mpv5/ui/panels/Bundle.properties" key="Stockmanager.jLabel1.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
+ </Property>
+ <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
+ </Properties>
+ </Component>
</SubComponents>
</Container>
</SubComponents>
View
40 src/mpv5/ui/panels/Stockmanager.java
@@ -76,13 +76,15 @@ private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jToolBar1 = new javax.swing.JToolBar();
auto = new javax.swing.JCheckBox();
+ jSeparator1 = new javax.swing.JToolBar.Separator();
jButton1 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
mainTable = new javax.swing.JTable();
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jButton2 = new javax.swing.JButton();
labeledTextField1 = new mpv5.ui.beans.LabeledTextField();
+ jLabel1 = new javax.swing.JLabel();
setName("Form"); // NOI18N
@@ -101,6 +103,9 @@ private void initComponents() {
auto.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
jToolBar1.add(auto);
+ jSeparator1.setName("jSeparator1"); // NOI18N
+ jToolBar1.add(jSeparator1);
+
jButton1.setText(bundle.getString("Stockmanager.jButton1.text")); // NOI18N
jButton1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jButton1.setFocusable(false);
@@ -155,24 +160,30 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
labeledTextField1.set_Label(bundle.getString("Stockmanager.labeledTextField1._Label")); // NOI18N
labeledTextField1.setName("labeledTextField1"); // NOI18N
+ jLabel1.setText(bundle.getString("Stockmanager.jLabel1.text")); // NOI18N
+ jLabel1.setName("jLabel1"); // NOI18N
+
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(jScrollPane1)
- .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 459, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE))
- .addComponent(labeledTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGap(18, 18, 18))
+ .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 539, Short.MAX_VALUE)
+ .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 459, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE))
+ .addComponent(labeledTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(jScrollPane1)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
+ .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jScrollPane2)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
@@ -181,8 +192,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(71, Short.MAX_VALUE))
+ .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -195,7 +205,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 23, Short.MAX_VALUE))
+ .addGap(0, 71, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
@@ -233,9 +243,11 @@ private void jTextArea1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:eve
private javax.swing.JCheckBox auto;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
+ private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
+ private javax.swing.JToolBar.Separator jSeparator1;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JToolBar jToolBar1;
private mpv5.ui.beans.LabeledTextField labeledTextField1;
@@ -264,7 +276,11 @@ public void run() {
Vector a = (Vector) it.next();
if (String.valueOf(a.elementAt(0)).equals(x)) {
- ((DefaultTableModel) mainTable.getModel()).setValueAt(Integer.valueOf(String.valueOf(a.elementAt(1))) + 1, row, 1);
+ try {
+ ((DefaultTableModel) mainTable.getModel()).setValueAt(Integer.valueOf(String.valueOf(a.elementAt(1))) + 1, row, 1);
+ } catch (NumberFormatException numberFormatException) {
+ Log.Debug(this, numberFormatException.getMessage());
+ }
return;
}
row++;

0 comments on commit 02f17c0

Please sign in to comment.