diff --git a/src/main/java/com/pharmacy/Views/ProductPage.form b/src/main/java/com/pharmacy/Views/ProductPage.form
index 09050f7..aafc5e7 100644
--- a/src/main/java/com/pharmacy/Views/ProductPage.form
+++ b/src/main/java/com/pharmacy/Views/ProductPage.form
@@ -311,6 +311,9 @@
+
+
+
@@ -379,7 +382,7 @@
-
+
diff --git a/src/main/java/com/pharmacy/Views/ProductPage.java b/src/main/java/com/pharmacy/Views/ProductPage.java
index 5414b1b..7b8b1d8 100644
--- a/src/main/java/com/pharmacy/Views/ProductPage.java
+++ b/src/main/java/com/pharmacy/Views/ProductPage.java
@@ -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);
}
@@ -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() {
@@ -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() {
diff --git a/src/main/java/com/pharmacy/Views/RestockPage.form b/src/main/java/com/pharmacy/Views/RestockPage.form
index fb2718a..eb89b5a 100644
--- a/src/main/java/com/pharmacy/Views/RestockPage.form
+++ b/src/main/java/com/pharmacy/Views/RestockPage.form
@@ -298,7 +298,7 @@
-
+
diff --git a/src/main/java/com/pharmacy/Views/RestockPage.java b/src/main/java/com/pharmacy/Views/RestockPage.java
index bb22e0d..421d5ca 100644
--- a/src/main/java/com/pharmacy/Views/RestockPage.java
+++ b/src/main/java/com/pharmacy/Views/RestockPage.java
@@ -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() {
diff --git a/src/main/java/com/pharmacy/Views/SalesPage.form b/src/main/java/com/pharmacy/Views/SalesPage.form
index 0df047e..d5b2589 100644
--- a/src/main/java/com/pharmacy/Views/SalesPage.form
+++ b/src/main/java/com/pharmacy/Views/SalesPage.form
@@ -108,25 +108,23 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
@@ -314,7 +312,6 @@
-
diff --git a/src/main/java/com/pharmacy/Views/SalesPage.java b/src/main/java/com/pharmacy/Views/SalesPage.java
index 5247073..4667ac2 100644
--- a/src/main/java/com/pharmacy/Views/SalesPage.java
+++ b/src/main/java/com/pharmacy/Views/SalesPage.java
@@ -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()
@@ -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);
@@ -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);
}
diff --git a/src/main/java/com/pharmacy/Views/SupplierPage.form b/src/main/java/com/pharmacy/Views/SupplierPage.form
index 360b226..8e3a333 100644
--- a/src/main/java/com/pharmacy/Views/SupplierPage.form
+++ b/src/main/java/com/pharmacy/Views/SupplierPage.form
@@ -38,16 +38,16 @@
-
+
-
+
-
+
@@ -134,9 +134,9 @@
-
-
-
+
+
+
@@ -171,7 +171,7 @@
-
+
@@ -253,10 +253,11 @@
+
-
+
diff --git a/src/main/java/com/pharmacy/Views/SupplierPage.java b/src/main/java/com/pharmacy/Views/SupplierPage.java
index 4ef6135..c0f168f 100644
--- a/src/main/java/com/pharmacy/Views/SupplierPage.java
+++ b/src/main/java/com/pharmacy/Views/SupplierPage.java
@@ -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())
);
@@ -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});
@@ -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() {
@@ -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)
diff --git a/src/main/java/com/pharmacy/Views/UsersPage.form b/src/main/java/com/pharmacy/Views/UsersPage.form
index 2ffc0c1..58db90e 100644
--- a/src/main/java/com/pharmacy/Views/UsersPage.form
+++ b/src/main/java/com/pharmacy/Views/UsersPage.form
@@ -71,7 +71,6 @@
-
@@ -314,7 +313,7 @@
-
+
diff --git a/src/main/java/com/pharmacy/Views/UsersPage.java b/src/main/java/com/pharmacy/Views/UsersPage.java
index 7380bda..e6f4c8b 100644
--- a/src/main/java/com/pharmacy/Views/UsersPage.java
+++ b/src/main/java/com/pharmacy/Views/UsersPage.java
@@ -186,7 +186,7 @@ public boolean isCellEditable(int rowIndex, int columnIndex) {
});
userTable.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
userTable.setName("Users"); // NOI18N
- userTable.setRowHeight(30);
+ userTable.setRowHeight(35);
userTable.setShowGrid(true);
userTable.getTableHeader().setReorderingAllowed(false);
userTable.addMouseListener(new java.awt.event.MouseAdapter() {
@@ -286,8 +286,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(entryPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, 0)))
+ .addComponent(entryPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
@@ -405,16 +404,20 @@ private void changePasswordActionPerformed(java.awt.event.ActionEvent evt) {//GE
}//GEN-LAST:event_changePasswordActionPerformed
+ private void processColumns() {
+ // hide PID column (data still accessible)
+ userTable.getColumnModel().getColumn(0).setPreferredWidth(0);
+ userTable.getColumnModel().getColumn(0).setMinWidth(0);
+ userTable.getColumnModel().getColumn(0).setMaxWidth(0);
+ }
+
public void loadSearchData(String text) {
EventQueue.invokeLater(() -> {
try {
UserController userController = new UserController();
userTable.setModel(userController.buildUsersTable(userController.searchUsers(text)));
- // hide PID column (data still accessible)
- userTable.getColumnModel().getColumn(0).setPreferredWidth(0);
- userTable.getColumnModel().getColumn(0).setMinWidth(0);
- userTable.getColumnModel().getColumn(0).setMaxWidth(0);
+ processColumns();
} catch (SQLException e) {
e.printStackTrace();
}
@@ -427,10 +430,7 @@ public final void loadDataSet() {
UserController userController = new UserController();
userTable.setModel(userController.buildUsersTable(userController.getUsers()));
- // hide PID column (data still accessible)
- userTable.getColumnModel().getColumn(0).setPreferredWidth(0);
- userTable.getColumnModel().getColumn(0).setMinWidth(0);
- userTable.getColumnModel().getColumn(0).setMaxWidth(0);
+ processColumns();
} catch (SQLException ex) {
ex.printStackTrace();
}