Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Main class calling JPanel from JFrame
- publicc class Main{
- public static void main(String arg[]{
- //--the beginning of event--
- private void open_ViewActionPerformed(java.awt.event.ActionEvent evt) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- JFrame frame = new JFrame();
- frame.setContentPane(new View()); // <--calling the constructor of View class
- frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- frame.pack();
- frame.setVisible(true);
- }
- });
- //--the end of event--
- }
- }
- //View class with JPanel edited by GUI Designer
- class View extends JPanel {
- public View() { // <-- the consructor of View class
- initComponents();
- }
- private void initComponents(){ // <-- coded by GUI Designer
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment