J2me sdk 3.0  problems in System.out.print

Hi
I can not use println to print Chinese .
First I just use System.out.print("test") to print some debug information , and I surprised to find it print nothing.
Then I try System.out.println("test") and it worked well. But there still problem when print Chinese,
like System.out.println("测试") and it just print a mistake string as "??" !
Can some tell me how to solved it, thanks .

Note: This thread was originally posted in the [Sun Java Wireless Toolkit|http://forums.sun.com/forum.jspa?forumID=82] forum, but moved to this forum for closer topic alignment.

Similar Messages

  • Problem with national characters calling System.out.print(...)

    I need to develop an application printing spanish characters like "�" (ce trencada) "�", "�", etc.
    The problem is when I type
    System.out.print("�")in my application, I get "plus-minus" symbol while executing it.
    Anyone can help me, please?
    Thank you in advance.

    check the list of fonts available. You can use the following code for the purpose.
      public static void main(String args[])
            String fonts[] = getFontNames();
            for(int i = 0; i < fonts.length; i++)
                System.out.println(fonts);
    public static String[] getFontNames()
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    return ge.getAvailableFontFamilyNames();

  • Problems with System.out.println()

    I tried writing a simple 'Hello world'-program:
    public class Test{
         public static void main(String[] args){
              System.out.println("Hello World!");
         }//main()
    }//Test
    But the text wouldn't appear in the DOS-window. The only text that showed up was the standard 'Press any key to close the window'. The program compiled without any problems, but didn't work when I tried to run it.
    Does anyone have any idea what's wrong?

    Are u sure , the main() class part is donecorrectly.
    Becuse program will compile but not run without a
    main() class.what do you mean by main() class???First of all main() is a method, not a class. The main() method the JRE recognizes and runs is the:
    public static void main(String[] params)
    If you don�t have exaclty those modifiers and receive an array of Strings parameter it will send you an runtime exception.
    Your code compiles and runs fine, the problem isn�t really System.out.print() it is something with your configuration.
    I have to rename the class to TestF. Here is the running:
    C:\cJava>javac TestF.java
    C:\cJava>java TestF
    Hello World!

  • Java - Eclipse debug applet with System.out.print in jboss console

    I use System.out.print to debug my java programs using Eclipse. I'm new
    with applets, and when nothing showed up in the applet window, I tried
    using print statements. I was expecting to see them in the jboss console like
    always, but there was nothing there. I tried looking this problem up
    online and found nothing. Does anyone know how I can use print
    statements to debug my applet? (Japplet to be specific).

    System.out.println works for me. The output statment are visible in the Console Window within Eclipse.

  • Strange System.out.print behavior inside a for loop

    I'm trying to create a simple ASCII progress bar in the console that would display like this:
    |--------------------------------------------|
    ============================More equal signs would appear as time goes on. At least this is what I want to happen.
    Instead, what happens is, none of the equal signs are printed until the very end, after the for loop in which the System.out.print("=") statement is in, has exited.
    This is my code (probably more than necessary is shown, but the important part is the for loop):
        public void addSomeDiffys(int numOfDiffys, int minInt, int maxInt) {
            Diffy currentDiffy;
            System.out.println("\nCreating Diffys.");
            System.out.println("|--------------------------------------------|");
            for (int i=0; i < numOfDiffys; i++) {
                currentDiffy = new Diffy(minInt, maxInt);
                if ((i/(double)numOfDiffys)*100 % 2 == 0)
                    System.out.print("=");
                diffyList.add(currentDiffy);           
            System.out.println("\n" + diffyList.size() + " Diffys created.\n");
            System.out.println("Sorting according to highest rating...");
            Collections.sort(diffyList,Diffy.HIGHEST_RATING_ORDER);
            System.out.println("Done.\n");
        }I also tried changing the System.out.print("="); to System.out.println("="); This time it works as expected, its just not very pretty...
    I get something like this:
    |--------------------------------------------|
    =
    =
    =
    =
    =
    =
    =
    =
    =
    =
    =
    =So again, when I use println, rather than print, the equal signs are printed over time, slowly, as the progress increases. When using print, Nothing happens for a long time, and then suddenly they all appear after the for loop has terminated, which makes no sense.
    Thanks for any help.

    When using print, Nothing happens
    for a long time, and then suddenly they all appear
    after the for loop has terminated, which makes no
    sense.
    Yes it does make sense! The characters are buffered inside the PrintStream and written when there is a full line to write. You could try a flush() after each = is written but I have no confidence that it will make any difference.

  • How to view System.out.print() messages for adapters in OIM 9.0.3

    I have created an adaptor for OIM from a java jar file. When that adaptor executes after some updates on tables it produces some execptions/error.
    I can not see the details of these exceptions as I do not know where is the standard output located when adapter is executed via OIM.
    Where cen I see output from my code lines that contain: System.out.println()?
    thanks

    I am not sure if logging is enabled as OIM was installed previously by another person - how can I check if it is enabled and how to use log4j in this case?
    OIM Design Console window shows no messages comming from my System.out.print() statements.
    /br
    Djeno

  • HOW TO system.out.PRINT a curly brace: {

    How is it possible to print a {  with command: system.out.print{ "text { text"}; ?
    Thanks

    How is it possible to print a {  with command:
    system.out.print{ "text { text"}; ?
    ThanksYour command has 2 errors in it.
    1) "system" must start with a capital "S"
    2) You used curly brackets where you should have used parentheses
    This works: System.out.print( "text { text");
    (although I suspect that you really want to use println, not print)

  • How do you overwrite System.out.print()

    I am sure there is a way to over write the last entry to System.out.print ?
    I think it is by using an escape sequence (eg \t or \n), but cant work out which letter to use.
    can any one help?
    Simon

    It's \r:
    class Overwrite {
         public static void main(String[] args) {
              System.out.print("Old Text");
              System.out.print("\rNew");
    }

  • Why System.out.println() is ok but System.out.print(); ?

    why System.out.println() is ok but System.out.print();?
    if i leave empty between parantheses in print .compiler gives error but println() doesnt?

    gimbal2 wrote:
    Think about it for a moment. What would System.out.print() do without any parameters? What CAN it do?That's easy: print() COULD behave like println() without writing a newline at the end ;)
    But I agree with Kayaman and Ram: javadoc is very nice, you simply have to read it.

  • How to create a class like System.out.print

    Hi,
    I need to create a class like System.out.print
    Say for ex: i have a class A ..
    I need to call it A.b.c
    cis the method..
    could you tell me, how can i do this..
    AMJ

    class A{
    public static final B b=new B();
    class B{
    public String getXXX(){
    return "Callled getXXX()";
    public class C{
    public static void main(String[] args)
    System.out.println(A.b.getXXX());
    }

  • System.out.print and System.out.println

    is it true that the System.out.print("\n") will print a new line character in all platforms?
    in other words is it ok to assume that System.out.print("\n") and System.out.println(); will give the same output regardless of platform?

    System.out.print("\n") Chances are that will produce different results on different platforms as some platforms use \n, some use \r some use \n\r (or is it \r\n?).
    The question is why do you care when System.out.println() will do what you want? An alternative:
    System.out.print(System.getProperty("line.separator"));

  • Difference between " system.out.print( ) " and " system.out.println( ) "?

    Hi frnds, i m a beginner in JAVA today only started with the complete refrence....can you help me and tell the the Difference between " system.out.print( ) " and " system.out.println( ) "?

    Rashid2753 wrote:
    hi,Yes. But it's a good idea for new Java programmers to become accustomed to using helpful resources like the API Javadocs because it's much faster then waiting for replies everytime you have a question. For experienced developers the API Javadocs are an indispensible resource.

  • System.in.read and System.out.print questions

    On the following code, two questions:
    1. the output is not what I expected. Why doesn't the System.out.println(i+" "+(char)i); print everytime i press enter a character? It seems to print all at once after everything is entered.
    package stars;
    import java.io.*;
    public class Stars {
      public static void main (String[] args) throws IOException {
        String U="";
        System.out.print("What is your name: ");
        while (true) {
          int i=System.in.read();
          U+=(char)i;
          System.out.println(i+" "+(char)i);
          System.out.flush();
          if (i==10||i==13) break;
        System.out.println("\rHello "+U);
    }C:\>java -cp . stars/Stars
    What is your name: blah
    98 b
    108 l
    97 a
    104 h
    13
    Hello blah
    2. What is the most natural way to check for the press of an enter key? Is there a java attribute or method for the "Enter key" since it is different on unix and ms-dos? Thanks

    On the following code, two questions:
    1. the output is not what I expected. Why doesn't
    the System.out.println(i+" "+(char)i); print
    everytime i press enter a character? From:
    http://scv.bu.edu/Doc/Java/tutorial/java/nutsandbolts/input.html
    ================
    "The read() method provided by System.in reads a single character and returns either the character that was read or, if there are no more characters to be read, -1.
    When a program reads from the standard input stream, the program blocks waiting for you to type something in. The program continues to wait for input until you give it some indication that the input is complete. To indicate to any program that reads from the standard input stream that you have finished entering characters, type the end-of-input character appropriate for your system at the beginning of a new line"
    ================
    In other words, Java can't do what you want to do.
    <snip>
    >
    2. What is the most natural way to check for the
    press of an enter key? Is there a java attribute or
    method for the "Enter key" since it is different on
    unix and ms-dos? Thanks
    System.getProperty("line.separator");Jim S.

  • Problem with this out.print(status.equals(

    Hi i've got another problem.
    The following codes is as follows:
    String status = (String)rs.getString("Status"); //status is either "O" - Open or "C" - closed
    out.print(status)
    out.print(status.equals("O"));
    it returns me FALSE even in my database it is O... I am not sure why.. can someone enlighten me? and it works if i use
    out.print(status.charAt(0) == ('O');
    I am not sure why..
    please reply asap... thanks

    try follows
    out.print(status) ;
    status.trim();
    out.print(status.equals("O"));That won't change anything. status.trim() won't actually change status; it just returns a substring. If you actually want it trimmed, you should do this:
    status=status.trim();
    out.print(status);
    out.print(status.equals("O"));

  • How to open the server log file that displays messages of System.out.print

    Hi,
    I am working on a j2ee project. How can we access the default log file? I have put many System.out.println(..) method in different classes in order to get the program flow and to track the origin of the error.
    I opened the a log file named "defaultTrace.0.trc" in usr\sap\J2E\JC00\j2ee\cluster\server0\log installation directory. Although it shows the ecxeptions, It is not showing the messages that i have written to console with the help of System.out.println(..) method.
    Can anybody tell me the location of the log file where i can find my messages sent through System.out.println(..) function?
    Regards,
    Sudheesh...

    System.out.println goes to console, which is not a file... This whole thing is much easier if you use standard logging:
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/5c830ca67fd842b2e87b0c341c64cd/frameset.htm

Maybe you are looking for

  • How to add Image to Web Document Report?

    Hi, I need to add Logo in my report.  Please share how to achieve this, and are there any constrains regarding picture format, or placement of the image or report transformation(to XL/PDF) or printing. Thanks in advance, -Vishi

  • In my ipod classic 60gb fifth generation: it doesn't work anymore music

    please anybody can help me! I've got an IPOD Classic 60gb 5th generation (year 2006) my radio support still working but i can't hear music anymore! why?

  • Power Mac g3 Blue & white no video feed

    i have a g3 blue and white 350mhz, and it has no video feed it powers up and the hard disk spins up but no video feed

  • JSF View Path

    Is there a way to change the view path for files? So that when someone visits *.faces, the directory it searches for *.jsp files is user defined? Or is it always in the root web app directory? I like to put my files under WEB-INF/jsp or something sim

  • Deemed exportsales and back to back order sales

    HI,                   In one company interview I have been asked by the interviewr that have you worked on special sales process deemed export and back to bac order sales can any body explain what is this how will do you configure in SAP yours Digita