Results 1 to 3 of 3

Thread: Why wont Form2 f = new Form2(); not work?

  1. #1

    Thread Starter
    Fanatic Member invitro's Avatar
    Join Date
    Jan 2000
    Location
    Outside your window
    Posts
    547

    Unhappy

    Ok i created a f object.
    Form2 f = new Form2();
    but when i do, f.settext("12345");
    it wont set it. And also, i have a procedure in form2 called givemoney.

    If i do
    f.givemoney(val 1, val2);
    it wont set the money count the way it should.

    any ideas?
    ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It's probably something internal to Form2. Could you post some of your code, please?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Fanatic Member invitro's Avatar
    Join Date
    Jan 2000
    Location
    Outside your window
    Posts
    547
    Code:
    import com.ms.wfc.app.*;
    import com.ms.wfc.core.*;
    import com.ms.wfc.ui.*;
    import com.ms.wfc.html.*;
    /**
     * This class can take a variable number of parameters on the command
     * line. Program execution begins with the main() method. The class
     * constructor is not invoked unless an object of type 'Form3'
     * created in the main() method.
     */
    public class Form3 extends Form
    {
    	private int c_count;
    	public Form3()
    	{
    		super();
    
    		// Required for Visual J++ Form Designer support
    		initForm();		
    		c_count = 0;
    		// TODO: Add any constructor code after initForm call
    	}
    
    	/**
    	 * Form3 overrides dispose so it can clean up the
    	 * component list.
    	 */
    	public void dispose()
    	{
    		super.dispose();
    		components.dispose();
    	}
    
    
    
    	private void cheat_keyPress(Object source, KeyPressEvent e)
    	{
    	String c_get;
    		long c_put;
    		int lines;
    			Form1 master_cheat = new Form1();	
    	
    	c_get = "";
    	
    	
    	if(e.keyChar == 13) {
    	 
    		
    		String c_run [] = cheat.getLines();
    		c_get = c_run[c_count];
    		c_count += 1;
    	    	
    	if(c_get.substring(0,6).compareTo("money=")== 0)  {
    		// c_put = c_get.substring(5,c_get.length ());
    		c_get = c_get.substring(6,c_get.length()); 
    		c_put = Long.valueOf(c_get).longValue();
    	
    		
    	
    	master_cheat.addmoney(c_put,true);
    
    
    	
    	
    	
    	}
    	
    		}
    	
    }
    
    	private void cheat_textChanged(Object source, Event e)
    	{
    		
    	}
    
    
    
    	private void cheat_enter(Object source, Event e)
    	{
    		
    	
    	}
    
    	/**
    	 * NOTE: The following code is required by the Visual J++ form
    	 * designer.  It can be modified using the form editor.  Do not
    	 * modify it using the code editor.
    	 */
    	Container components = new Container();
    	Edit cheat = new Edit();
    
    	private void initForm()
    	{
    		this.setText("Cheat Form");
    		this.setAutoScaleBaseSize(new Point(5, 13));
    		this.setBorderStyle(FormBorderStyle.FIXED_SINGLE);
    		this.setClientSize(new Point(273, 153));
    		this.setMaximizeBox(false);
    
    		cheat.setSize(new Point(272, 152));
    		cheat.setTabIndex(0);
    		cheat.setText("");
    		cheat.setMultiline(true);
    		cheat.setScrollBars(ScrollBars.BOTH);
    		cheat.addOnEnter(new EventHandler(this.cheat_enter));
    		cheat.addOnKeyPress(new KeyPressEventHandler(this.cheat_keyPress));
    		cheat.addOnTextChanged(new EventHandler(this.cheat_textChanged));
    
    		this.setNewControls(new Control[] {
    							cheat});
    	}
    
    	/**
    	 * The main entry point for the application. 
    	 *
    	 * @param args Array of parameters passed to the application
    	 * via the command line.
    	 */
    	public static void main(String args[])
    	{
    		Application.run(new Form3());
    	}
    }
    This is my entire Form3
    Theres the addmoney function in Form1 im traying to call out, but it wont even work. Same if i do master_cheat.setText("12345");
    it wont set.


    [Edited by invitro on 08-24-2000 at 11:10 PM]
    ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet?

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