Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
resize table rows to 35
Browse files Browse the repository at this point in the history
  • Loading branch information
jhdcruz committed Dec 12, 2022
1 parent 17298e2 commit 198c576
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 70 deletions.
5 changes: 4 additions & 1 deletion src/main/java/com/pharmacy/Views/ProductPage.form
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="33" green="33" red="ff" type="rgb"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="33" green="33" red="33" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="Delete"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Hand Cursor"/>
Expand Down Expand Up @@ -379,7 +382,7 @@
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Hand Cursor"/>
</Property>
<Property name="rowHeight" type="int" value="30"/>
<Property name="rowHeight" type="int" value="35"/>
<Property name="showGrid" type="boolean" value="true"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/pharmacy/Views/ProductPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,8 @@ private void initComponents() {
suppCombo.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
}

public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
}

public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
suppComboPopupMenuWillBecomeVisible(evt);
}
Expand Down Expand Up @@ -126,6 +124,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
});

deleteButton.setBackground(new java.awt.Color(255, 51, 51));
deleteButton.setForeground(new java.awt.Color(51, 51, 51));
deleteButton.setText("Delete");
deleteButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
deleteButton.addActionListener(new java.awt.event.ActionListener() {
Expand Down Expand Up @@ -262,7 +261,7 @@ public boolean isCellEditable(int rowIndex, int columnIndex) {
});
productTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
productTable.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
productTable.setRowHeight(30);
productTable.setRowHeight(35);
productTable.setShowGrid(true);
productTable.getTableHeader().setReorderingAllowed(false);
productTable.addMouseListener(new java.awt.event.MouseAdapter() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pharmacy/Views/RestockPage.form
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
<Column editable="false" title="Title 4" type="java.lang.Object"/>
</Table>
</Property>
<Property name="rowHeight" type="int" value="30"/>
<Property name="rowHeight" type="int" value="35"/>
<Property name="showGrid" type="boolean" value="true"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pharmacy/Views/RestockPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit[columnIndex];
}
});
purchaseTable.setRowHeight(30);
purchaseTable.setRowHeight(35);
purchaseTable.setShowGrid(true);
purchaseTable.getTableHeader().setReorderingAllowed(false);
purchaseTable.addMouseListener(new java.awt.event.MouseAdapter() {
Expand Down
29 changes: 13 additions & 16 deletions src/main/java/com/pharmacy/Views/SalesPage.form
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,23 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jDateChooser1" max="32767" attributes="0"/>
</Group>
<Group type="103" groupAlignment="1" max="-2" attributes="0">
<Group type="102" attributes="0">
<Component id="jLabel2" min="-2" pref="119" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="custCodeText" linkSize="3" min="-2" pref="135" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="prodCodeText" linkSize="3" min="-2" pref="142" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel2" min="-2" pref="119" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<Component id="custCodeText" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
<Component id="prodCodeText" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="deleteButton" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="clearButton" min="-2" pref="127" max="-2" attributes="0"/>
<Component id="deleteButton" pref="128" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="clearButton" pref="127" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -314,7 +312,6 @@
<Column editable="false" title="Title 4" type="java.lang.Object"/>
</Table>
</Property>
<Property name="autoResizeMode" type="int" value="0"/>
<Property name="rowHeight" type="int" value="30"/>
<Property name="showGrid" type="boolean" value="true"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
Expand Down
33 changes: 14 additions & 19 deletions src/main/java/com/pharmacy/Views/SalesPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,20 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDateChooser1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(sellPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(sellPanelLayout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(custCodeText, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(sellPanelLayout.createSequentialGroup()
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(prodCodeText, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sellPanelLayout.createSequentialGroup()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(custCodeText))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, sellPanelLayout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(25, 25, 25)
.addComponent(prodCodeText))
.addGroup(sellPanelLayout.createSequentialGroup()
.addComponent(deleteButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(deleteButton, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(clearButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(clearButton, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)))
.addContainerGap())
);

sellPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[]{custCodeText, prodCodeText});

sellPanelLayout.setVerticalGroup(
sellPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(sellPanelLayout.createSequentialGroup()
Expand Down Expand Up @@ -235,7 +231,6 @@ public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit[columnIndex];
}
});
salesTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
salesTable.setRowHeight(30);
salesTable.setShowGrid(true);
salesTable.getTableHeader().setReorderingAllowed(false);
Expand Down Expand Up @@ -437,11 +432,11 @@ private void searchTextKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:eve
}//GEN-LAST:event_searchTextKeyReleased

private void resizeColumnWidths() {
salesTable.getColumnModel().getColumn(0).setPreferredWidth(90);
salesTable.getColumnModel().getColumn(0).setPreferredWidth(60);
salesTable.getColumnModel().getColumn(1).setPreferredWidth(120);
salesTable.getColumnModel().getColumn(2).setPreferredWidth(120);
salesTable.getColumnModel().getColumn(3).setPreferredWidth(120);
salesTable.getColumnModel().getColumn(4).setPreferredWidth(100);
salesTable.getColumnModel().getColumn(2).setPreferredWidth(220);
salesTable.getColumnModel().getColumn(3).setPreferredWidth(50);
salesTable.getColumnModel().getColumn(4).setPreferredWidth(80);
salesTable.getColumnModel().getColumn(5).setPreferredWidth(170);
salesTable.getColumnModel().getColumn(6).setPreferredWidth(150);
}
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/com/pharmacy/Views/SupplierPage.form
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
<Component id="jSeparator3" alignment="0" min="-2" pref="307" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="227" max="32767" attributes="0"/>
<Component id="jScrollPane1" pref="464" max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<EmptySpace min="0" pref="393" max="32767" attributes="0"/>
<Component id="jSeparator2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<EmptySpace min="0" pref="393" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
Expand Down Expand Up @@ -134,9 +134,9 @@
<Component id="nameText" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="deleteButton" min="-2" pref="96" max="-2" attributes="0"/>
<EmptySpace pref="60" max="32767" attributes="0"/>
<Component id="editButton" pref="129" max="32767" attributes="0"/>
<Component id="deleteButton" min="-2" pref="121" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="editButton" min="-2" pref="158" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
Expand Down Expand Up @@ -171,7 +171,7 @@
<Component id="deleteButton" linkSize="1" alignment="3" min="-2" pref="40" max="-2" attributes="0"/>
<Component id="editButton" linkSize="1" alignment="3" min="-2" pref="40" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="74" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
Expand Down Expand Up @@ -253,10 +253,11 @@
<Column editable="false" title="Title 4" type="java.lang.Object"/>
</Table>
</Property>
<Property name="autoResizeMode" type="int" value="4"/>
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
<Color id="Hand Cursor"/>
</Property>
<Property name="rowHeight" type="int" value="30"/>
<Property name="rowHeight" type="int" value="35"/>
<Property name="showGrid" type="boolean" value="true"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/com/pharmacy/Views/SupplierPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(nameText))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
.addComponent(editButton, javax.swing.GroupLayout.DEFAULT_SIZE, 129, Short.MAX_VALUE)))
.addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);

Expand Down Expand Up @@ -136,7 +136,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(editButton, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(74, 74, 74))
.addContainerGap())
);

jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[]{deleteButton, editButton});
Expand All @@ -163,8 +163,9 @@ public boolean isCellEditable(int rowIndex, int columnIndex) {
return canEdit[columnIndex];
}
});
suppTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
suppTable.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
suppTable.setRowHeight(30);
suppTable.setRowHeight(35);
suppTable.setShowGrid(true);
suppTable.getTableHeader().setReorderingAllowed(false);
suppTable.addMouseListener(new java.awt.event.MouseAdapter() {
Expand Down Expand Up @@ -229,13 +230,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(addButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 307, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 227, Short.MAX_VALUE)))
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 464, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGap(0, 393, Short.MAX_VALUE)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(0, 393, Short.MAX_VALUE)))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/pharmacy/Views/UsersPage.form
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
<Component id="jSeparator2" min="-2" pref="5" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="entryPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
Expand Down Expand Up @@ -314,7 +313,7 @@
<Color id="Hand Cursor"/>
</Property>
<Property name="name" type="java.lang.String" value="Users" noResource="true"/>
<Property name="rowHeight" type="int" value="30"/>
<Property name="rowHeight" type="int" value="35"/>
<Property name="showGrid" type="boolean" value="true"/>
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
Expand Down
Loading

0 comments on commit 198c576

Please sign in to comment.