User Profile

Collapse

Profile Sidebar

Collapse
xirowei
xirowei
Last Activity: Sep 5 '11, 02:46 PM
Joined: Jun 10 '07
Location: Malaysia
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Dear Ian Smith,

    I try your solution and it works! The main issue in my code is:

    //Incorrect code
    MyRobot myrobot = new MyRobot();

    //Correct code
    Robot myrobot = new Robot();
    See more | Go to post

    Leave a comment:


  • xirowei
    started a topic java.awt.Robot - Stimulate Key Press Not Working
    in Java

    java.awt.Robot - Stimulate Key Press Not Working

    Dear All,

    I had google for example how to use java.awt.Robot class. I also read Java Document regarding of awt.Robot class. When I test below code, I get error message "cannot find symbol method delay(int)" and "cannot find symbol method keyPress (int)". May I know what is my problem?

    *Installed JDK Version 6 update 21

    Code:
    import java.awt.AWTException;
    import java.awt.Robot;
    ...
    See more | Go to post

  • xirowei
    replied to Java Array Problem
    in Java
    Thanks for the advise on finding "new Result". I didn't aware that what I'm doing actually is initialize another Result object rather that manipulated on existing method. Now I finally know the problem is locate on MySurvey.java line 48. Need change from result.printRep ort(); to centerPanel.get Result().printR eport();

    Jos thank you very much....
    See more | Go to post

    Leave a comment:


  • xirowei
    replied to Java Array Problem
    in Java
    Java Array Problem, unable to print out accumulate value.

    I been keep trace the problem for very long but i still cannot find the reason why it cant print out the correct output. Hereby i show all classes in my small Java Application. Hope anyone able to help me identify the source of the problem causing printing zero value in the array.

    ButtonPanel.jav a
    Code:
    import java.awt.*;
    import java.awt.event.*;
    ...
    See more | Go to post
    Last edited by xirowei; Apr 6 '08, 11:17 AM. Reason: Bytes.com got bug in showing Java code, hence i adding in comment to notice other user that the line of code that appear invalid actually is a line of correct code.

    Leave a comment:


  • xirowei
    started a topic Java Array Problem
    in Java

    Java Array Problem

    Code:
    public class Result
    {
    	private int countA = 0;
    	private int countB = 0;
    	private int statement;
    	private boolean statusA = false;
    	private boolean statusB = false;
    	[B]private int[] arrayA = new int[2]; [B]<= the problem seem like happen at here?[/B]
    	private int[] arrayB = new int[2];[/B] [B]<= the problem seem like happen at here?[/B]
    
    	public Result()
    	{
    
    	}
    	public
    ...
    See more | Go to post

  • xirowei
    replied to How to compute Permutation of 4P3?
    in Java
    Thanks. I already found a way to compute out permutation with allow repeats....
    See more | Go to post
    Last edited by xirowei; Mar 24 '08, 09:35 AM. Reason: correct typo error

    Leave a comment:


  • xirowei
    replied to How to compute Permutation of 4P3?
    in Java
    I'm not sure is this the one i searching for because after compile and run that example i get following error message:

    Exception in thread "main" java.lang.Array IndexOutOfBound sException: 0
    at Permutation.mai n(Permutation.j ava:20)

    Is there any way to fix it so i able to run and view the output?

    Code:
    /*************************************************************************
     *  Compilation:
    ...
    See more | Go to post

    Leave a comment:


  • xirowei
    started a topic How to compute Permutation of 4P3?
    in Java

    How to compute Permutation of 4P3?

    Let's say i create a String array that store 4 Alphabets {"A","B","C","D "}
    How can i get the result if i need permutation of 4P3 and 4P2?

    I had refer to many examples from the internet, but those examples cannot compute n selection from m elements. They only able to computer permutation of m elements without selection e.g. 4P4.

    Hence i need guideline in how to compute...
    See more | Go to post

  • xirowei
    replied to php echo problem
    in PHP
    Thanks for your help.
    See more | Go to post

    Leave a comment:


  • xirowei
    started a topic php echo problem
    in PHP

    php echo problem

    echo "<td width=\"300\" align=\"left\"> <?php echo $_SESSION['EmployeeNo'] ?></td>";

    The above line of code give me the error message:
    "Parse error: syntax error, unexpected T_ENCAPSED_AND_ WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\XAMPP\htdocs \DW\personalDet ail.php on line 132"

    I new to php, no idea how to fix this issue, i just...
    See more | Go to post

  • xirowei
    started a topic How to set more than one attribute in same cookie?
    in Java

    How to set more than one attribute in same cookie?

    I try to search information from many websites, but what i can found is they only demonstrate the example with ONE ATTRIBUTE in a Cookie only.

    What i want is how to set more than 1 attribute in a same cookie?

    Below is my code: currently i only can show the username but cannot show the age. How to enable the ShowCookie.jsp able to show both the attribute of "username" and "age" enter by User?
    ...
    See more | Go to post

  • I finally figure out the correct way to do this question. Below is the working code.

    Code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    
    public class LabWork3_Q1 extends HttpServlet
    {		
    	public void doGet(HttpServletRequest request, HttpServletResponse response) 
    		throws ServletException, IOException
    		{
    			response.setContentType("text/html");
    ...
    See more | Go to post

    Leave a comment:


  • I had been working on this question and here is my latest version (still contain problem)
    My problem is WHY the doPost method UNABLE to receive parameter of textfield name "word" from doGet method?

    Code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    
    public class LabWork3_Q1 extends HttpServlet
    {		
    	public void doGet(HttpServletRequest request, HttpServletResponse
    ...
    See more | Go to post

    Leave a comment:


  • I had make some modify but now encounter new problem in count length function.
    After i enter a word and click on Submit button, Tomcat show line 34 error, may i know how to solve this problem?

    Code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    
    public class LabWork3_Q1 extends HttpServlet
    {		
    	public void doGet(HttpServletRequest request, HttpServletResponse
    ...
    See more | Go to post
    Last edited by xirowei; Oct 1 '07, 05:45 PM. Reason: incomplete explaination on question

    Leave a comment:


  • how to pass variable from public void doGet to public void doPost?

    i'm newbie in java servlet, how to let public void doPost can access to public void doGet, stringLength variable?
    below is my code:

    Code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    
    public class LabWork3_Q1 extends HttpServlet
    {	
    	public void doGet(HttpServletRequest request, HttpServletResponse response) 
    		throws ServletException, IOException
    ...
    See more | Go to post

  • epots9 thank you very much. You guide is really simple and easy to understand. Now it solve my problem of the non-static problem.
    See more | Go to post

    Leave a comment:


  • non-static method problem: how to access non-static method from another .java file?

    i now learning Object Oriented Programming but stuck. Need help. Below is the code.


    [CODE=java] PanelOption.jav a
    import java.awt.*;
    import java.awt.event. *;
    import javax.swing.*;
    import javax.swing.eve nt.*;

    public class PanelOption extends JPanel
    {
    //some code

    public PanelOption()
    {
    createOptionGUI ();
    }
    ...
    See more | Go to post
    Last edited by r035198x; Jun 14 '07, 03:14 PM. Reason: added code tags
No activity results to display
Show More
Working...