Results 1 to 8 of 8
  1. #1
    alvalv is offline Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0

    Default meaning of the ouput of System.outprint( JFrame jf )

    I have a class thant extends JFrame

    Java Code:
    public class CA extends JFrame {	// code	
    	}
    In another class:

    Java Code:
    CA ca = new CA();
    System.out.print("\n ca = " +ca);
    The output of the print is:
    ca = CA[frame2,212,184,600x400,invalid,layout=java.awt.Bor derLayout,title=,resizable,normal,defaultCloseOper ation=DISPOSE_ON_CLOSE,rootPane=javax.swing.JRootP ane[,5,25,590x370,invalid,layout=javax.swing.JRootPane $RootLayout,alignmentX=0.0,alignmentY=0.0,border=, flags=16777673,maximumSize=,minimumSize=,preferred Size=],rootPaneCheckingEnabled=true]

    ¿ Where can I search the meaning of "frame2", "invalid", "normal", flags=12777673" etc ... ?

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    758
    Rep Power
    8

    Default Re: meaning of the ouput of System.outprint( JFrame jf )

    You must check the toString() method of the CA class. The System.out.print() will ask for a string representation of your object. Which in this case should be provided by the CA class toString() method.

  3. #3
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,538
    Rep Power
    5

    Default Re: meaning of the ouput of System.outprint( JFrame jf )

    Check the JFrame hierarchy for an isValid() method. The documentation in the API will explain what a valid JFrame is.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  4. #4
    alvalv is offline Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0

    Default Re: meaning of the ouput of System.outprint( JFrame jf )

    From the JFrame documentation:
    Methods inherited from class java.awt.Component : ..... toString, ....

    From the Component documentation:
    toString
    public String toString()
    Returns a string representation of this component and its values.
    Overrides:
    toString in class Object
    Returns:
    a string representation of this component
    Since:
    JDK1.0


    This does not help much. Thanks anyway.
    Last edited by alvalv; 03-07-2013 at 04:11 PM.

  5. #5
    alvalv is offline Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0

    Default Re: meaning of the ouput of System.outprint( JFrame jf )

    Quote Originally Posted by jim829 View Post
    Check the JFrame hierarchy for an isValid() method. The documentation in the API will explain what a valid JFrame is.

    Regards,
    Jim
    Methods inherited from class java.awt.Component: .... isValid ...


    isValid
    public boolean isValid()
    Determines whether this component is valid. A component is valid when it is correctly sized and positioned within its parent container and all its children are also valid. In order to account for peers' size requirements, components are invalidated before they are first shown on the screen. By the time the parent container is fully realized, all its components will be valid.

    Returns:
    true if the component is valid, false otherwise
    Since:
    JDK1.0
    See Also:
    validate(), invalidate()

    Thank you, but this is not the answer I am looking for.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,953
    Rep Power
    19

    Default Re: meaning of the ouput of System.outprint( JFrame jf )

    Look at the source code?
    It's all there.
    Java Code:
        public String toString() {
            return getClass().getName() + "[" + paramString() + "]";
        }
    paramString() is:
    Java Code:
        protected String paramString() {
            String thisName = getName();
            String str = (thisName != null? thisName : "") + "," + x + "," + y + "," + width + "x" + height;
            if (!isValid()) {
                str += ",invalid";
            }
            if (!visible) {
                str += ",hidden";
            }
            if (!enabled) {
                str += ",disabled";
            }
            return str;
        }
    and the children of Component override this, calling super.paramString() to print out the parent parameters.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    jim829 is online now Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,538
    Rep Power
    5

    Default Re: meaning of the ouput of System.outprint( JFrame jf )

    Quote Originally Posted by alvalv View Post
    ¿ Where can I search the meaning of "frame2", "invalid", "normal", flags=12777673" etc ... ?
    Well, you asked for the meaning of a variety of state indicators. I simply showed you how to determine one of them. Namely "invalid." Others can be found by perusing the source code.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  8. #8
    alvalv is offline Member
    Join Date
    Sep 2012
    Posts
    9
    Rep Power
    0

    Default Re: meaning of the ouput of System.outprint( JFrame jf )

    Thank you for your answers. I'm still digging into the code. It's all there, isnt it ?

Similar Threads

  1. Time Intervals In Java Outprint
    By dharav in forum New To Java
    Replies: 5
    Last Post: 01-10-2012, 03:35 AM
  2. send an HTML code as ouput in browser
    By jrdncchr in forum Networking
    Replies: 1
    Last Post: 12-09-2011, 06:06 PM
  3. How to set the JFrame to System resolution
    By usha in forum AWT / Swing
    Replies: 4
    Last Post: 10-20-2010, 02:05 PM
  4. Creating Ouput Text File
    By Raian in forum New To Java
    Replies: 14
    Last Post: 05-24-2010, 09:56 AM
  5. want sql Query ouput in the calling HTML Form.. Pls Help
    By Faheem_Ahmed in forum Advanced Java
    Replies: 2
    Last Post: 03-05-2009, 08:08 PM

Posting Permissions

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