Java Classes
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
    SW Missouri
    Posts
    3,426

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center