Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-11-2009, 03:14 PM
Member
 
Join Date: Feb 2009
Posts: 20
Rep Power: 0
mgm2010 is on a distinguished road
Default Different Files Open in File -> Open Workspace
I ran and saved the following file in JCreator
Code:
//Print in tabs
//Java 2 page 196 EXERCISE
public class ControlJ02Pg0196PrintTabsFile20090411{
	public static void main( String args []){
		int x = 4;             //x initialized to 4
		
		while( x <= 40 ){
			System.out.print(x);
			
			if( x % 7 == 0)      //The number 7 here indicates the number of tabs
			System.out.println();
			
			else
			System.out.print( '\t');
			
			x += 4;         //x will vary in steps of 4
		}
	}
}
But when I open the same file from File -> Open Workspace, the following two files open
Code:
/**
 * AWT Sample application
 *
 * @author 
 * @version 1.00 09/04/11
 */
public class ControlJ02Pg0196PrintTabs20090411 {
    
    public static void main(String[] args) {
        // Create application frame.
        ControlJ02Pg0196PrintTabs20090411Frame frame = new ControlJ02Pg0196PrintTabs20090411Frame();
        
        // Show frame
        frame.setVisible(true);
    }
}
and
Code:
import java.awt.*;
import java.awt.event.*;

/**
 * Sample application using Frame.
 *
 * @author 
 * @version 1.00 09/04/11
 */
public class ControlJ02Pg0196PrintTabs20090411Frame extends Frame {
    
    /**
     * The constructor.
     */  
     public ControlJ02Pg0196PrintTabs20090411Frame() {
                
        MenuBar menuBar = new MenuBar();
        Menu menuFile = new Menu();
        MenuItem menuFileExit = new MenuItem();
        
        menuFile.setLabel("File");
        menuFileExit.setLabel("Exit");
        
        // Add action listener.for the menu button
        menuFileExit.addActionListener
        (
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    ControlJ02Pg0196PrintTabs20090411Frame.this.windowClosed();
                }
            }
        ); 
        menuFile.add(menuFileExit);
        menuBar.add(menuFile);
        
        setTitle("ControlJ02Pg0196PrintTabs20090411");
        setMenuBar(menuBar);
        setSize(new Dimension(400, 400));
        
        // Add window listener.
        this.addWindowListener
        (
            new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    ControlJ02Pg0196PrintTabs20090411Frame.this.windowClosed();
                }
            }
        );  
    }
    
    
    /**
     * Shutdown procedure when run as an application.
     */
    protected void windowClosed() {
    	
    	// TODO: Check if it is safe to close the application
    	
        // Exit application.
        System.exit(0);
    }
}
What is happening ?? I don,t even understand the above two files.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 04-22-2009, 06:22 PM
Member
 
Join Date: Apr 2009
Posts: 22
Rep Power: 0
sogotra is on a distinguished road
Default
thank you so much
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read and Open *.txt Files? help!! ashton New To Java 9 11-01-2009 04:42 PM
how to open a file through URL katie New To Java 3 07-13-2008 03:53 AM
Open File JavaLerner SWT / JFace 5 07-12-2008 07:41 PM
To open an image file such as Jpeg file using JAva Program itmani2020 Advanced Java 10 07-11-2008 10:57 AM
Is it possible to open a txt file? jason27131 New To Java 20 08-07-2007 02:24 AM


All times are GMT +2. The time now is 02:35 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org