itslindsay87
New member
- Apr 22, 2010
- 1
- 0
- 1
Hi,
i'm doing a project in uni. we have to deisgn and create a java application which will simulate a PDA system for stock control. i have never done java swing with the gui before and kind struggling. so far we have our increments for each of the options within the PDA system.
1.main menu - with all three options
2. View Product Details
3. Modify Product
4. Order Stock
so far we have our JFrame as the main menu with a JPanel on top and the rest of the options as JPanels. We are having problems at the simple stages of connectiong the JPanels together.SO far we can get the buttons on the main menu working but their taking us on totally new JPanels rather than ones already in our project i.e Option 1 View Product Details.
private void ViewProductDetailsActionPerformed(java.awt.event.ActionEvent evt) {
// when view product details button pressed the JPanel Option1 is displayed
JPanel Option1 = newJPanel;
Option1.setVisible(true);
MainPanel.setVisible(false);
we realized that the "JPanel Option1 = newJPanel;" is where we are going wrong and can't seem to get the part to where the button is clicked it takes us onto one of the existing JPanels within the project but a new JPanel instead.
When then thought it would be this but no luck so far.
private void ViewProductDetailsActionPerformed(java.awt.event.ActionEvent evt) {
// when view product details button pressed the JPanel Option1 is displayed
JPanel Option1 = JPanel("Option1");
Option1.setVisible(true);
MainPanel.setVisible(false);
Any Help, Solutions or Advice would be great
thank you
Lindsay
i'm doing a project in uni. we have to deisgn and create a java application which will simulate a PDA system for stock control. i have never done java swing with the gui before and kind struggling. so far we have our increments for each of the options within the PDA system.
1.main menu - with all three options
2. View Product Details
3. Modify Product
4. Order Stock
so far we have our JFrame as the main menu with a JPanel on top and the rest of the options as JPanels. We are having problems at the simple stages of connectiong the JPanels together.SO far we can get the buttons on the main menu working but their taking us on totally new JPanels rather than ones already in our project i.e Option 1 View Product Details.
private void ViewProductDetailsActionPerformed(java.awt.event.ActionEvent evt) {
// when view product details button pressed the JPanel Option1 is displayed
JPanel Option1 = newJPanel;
Option1.setVisible(true);
MainPanel.setVisible(false);
we realized that the "JPanel Option1 = newJPanel;" is where we are going wrong and can't seem to get the part to where the button is clicked it takes us onto one of the existing JPanels within the project but a new JPanel instead.
When then thought it would be this but no luck so far.
private void ViewProductDetailsActionPerformed(java.awt.event.ActionEvent evt) {
// when view product details button pressed the JPanel Option1 is displayed
JPanel Option1 = JPanel("Option1");
Option1.setVisible(true);
MainPanel.setVisible(false);
Any Help, Solutions or Advice would be great
thank you
Lindsay