CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Java Classes

  1. #1
    Join Date
    Feb 2013
    Posts
    22

    Java Classes

    I'm currently working on a program where i need to call another java class from a button listener in another class. For example i have a button in example1 and when i press that button i want to execute the whole example2 class(which is a slideshow application). Here is some of my code That has the button

    Code:
    JButton button2 = new JButton("button2");
    button2.addActionListener(new button2Listener());
    
    ....
    
    private class button2Listener implements ActionListener
    	{
    		public void actionPerformed(ActionEvent e)
    		{
    			// I'm confused on what to put here
    			
    
    
    		}
              }
    And here is some code from the other java class that i need to execute the whole file
    Code:
    public class Internal extends JFrame
    {
    
    	public Internal()
    	{
    
    		//Code for the slideshow goes here
    	}
    }
    	public static void main(String[] args)
    	{
    		Internal in = new Internal();
    		in.show();
    	}
    
    }
    Thanks.

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured