Hi Every one,
I am new at java swing and I am trying to add a Jpanel to my frame. I have three simple class as below
1-Class MyPanel
2-Class MyFrame
3-Class Main
I did my best to add the panel to my frame but it did not work! Could you please let me know what I am doing wrong!?
=====================
In MyPanel, you are adding the button to some different panel! Try changing pan.add(okButton); to this.add(okButton)
Check out the Swing tutorial. It is usally a good place to start learning Swing.