JDialog help
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Diego_Cimarosa
Posted On:   Thursday, August 3, 2006 07:03 AM

Good morning all I'm quit new to Java world and I'm trying to develop a Java application using NetBeans 5.0 that uses many JPanels. I have a JFrame class, MainFrame, with a JMenu component. Item "A" should launch panelA_00, item "B" should launch panelB_00. Both panelA_00 and panelB_00 have many components that perform data-base logic and four buttons each: "First","Previous","Next" and "Last". Each "Next" button should launch the next panel in chain with this schema: "Item A"->panelA_00->"Next"->panelA_01 ... And, of course, "Previous" button goes back on   More>>

Good morning all


I'm quit new to Java world and I'm trying to develop a Java application using NetBeans 5.0 that uses many JPanels.

I have a JFrame class, MainFrame, with a JMenu component.

Item "A" should launch panelA_00, item "B" should launch panelB_00.


Both panelA_00 and panelB_00 have many components that perform data-base logic

and four buttons each: "First","Previous","Next" and "Last".

Each "Next" button should launch the next panel in chain

with this schema: "Item A"->panelA_00->"Next"->panelA_01 ...

And, of course, "Previous" button goes back one panel.

I'm not able to complete this :



public class MainFrame extends javax.swing.JFrame {

...
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {

panelA_00 page = new panelA_00();

page.setVisible(true);

.... WHAT TO DO ... HERE ?

}

I have tried :

this.getContentPane().add(page);

and many other tries ... but nothings happens ...


I want "simply", replacing the pane with a new panel at every button clik.

PLEASE HELP !

Thanks all for any suggestion.

   <<Less

Re: JDialog help

Posted By:   Diego_Cimarosa  
Posted On:   Monday, August 7, 2006 10:38 AM

After many hours fighting with Swing and NetBeans I solved my problem !


public class MainFrame extends javax.swing.JFrame {

public MainFrame() {

initComponents();

this.setTitle("Invoice system");

}

... missing lines

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {

Customer panel = new Customer();

this.setContentPane(panel);

pack();

}


private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {

Invoice panel = new Invoice();

this.setContentPane(panel);

pack();

}


add other menu items ...


That's all folks!

About | Sitemap | Contact