Results 1 to 5 of 5
  1. #1
    wilnicm is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default New programing in java anyone know how to retrieve an objects property value of title

    Hi i created a collapsible pane of "A". This object has a property of TitledBorder.
    With in this Border I'm trying to get the title which i've already set.
    I don't know how to write code to retrieve to retrieve this. All the documentation
    i've read online i dont quite understand on how to retrieve this property or any kind of
    property in java.

    If anyone has a clue this would be appreciated. thanks
    Below is a snippet of what i've done so far but it hasnt worked

    import javax.swing.border.Border;
    Border s = HandheldcollapsePane.getBorder()
    when i create this object there is nothing in s that
    allows me to get to the title or retrieve the tile.

    Just know the basics is a clear to understand way of retrieving
    an objects property would be great. thanks

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,814
    Rep Power
    25

    Default Re: New programing in java anyone know how to retrieve an objects property value of t

    Can you cast it to the class that has the method to get the title?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    wilnicm is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default Re: New programing in java anyone know how to retrieve an objects property value of t

    Quote Originally Posted by Norm View Post
    Can you cast it to the class that has the method to get the title?
    mmmmm I'm not completely understanding on how to cast currently. The object which is an jxcollapsiblepane doesnt have any
    methods that i can apparently see that has a way for me to get the property.
    This object is accessible to me.
    I think the only method that i see is .getBorder
    but what do i do after i get border. How do i find out the title of the border for the collapsible pane?.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,814
    Rep Power
    25

    Default Re: New programing in java anyone know how to retrieve an objects property value of t

    If the Border object you get is a reference to a TitledBorder object, you could cast the Border object to TitledBorder and call its getTitle method.
    Last edited by Norm; 05-15-2014 at 11:16 PM.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    wilnicm is offline Member
    Join Date
    May 2014
    Posts
    22
    Rep Power
    0

    Default Re: New programing in java anyone know how to retrieve an objects property value of t

    Quote Originally Posted by Norm View Post
    If the Border object you get a reference to is a TitledBorder, you could cast the Border object to TitledBorder and call its getTitle method.
    Ok, when you mentioned the get title, i looked some more to see if i saw a method i could use on that object this is what i've come up with below
    I will run and debug to see if this works HandheldcollapsePane.getClientProperty("type").get Class().getName();
    Thanks.

Similar Threads

  1. Replies: 2
    Last Post: 10-23-2012, 03:29 PM
  2. Programing problem with objects and classes.
    By shadowwyvern99 in forum NetBeans
    Replies: 3
    Last Post: 11-14-2011, 09:25 AM
  3. java programing contest
    By ZVY-TRAG in forum Java Software
    Replies: 4
    Last Post: 08-17-2011, 05:44 AM
  4. Regarding OS for Java Programing
    By Sanjeeva in forum Advanced Java
    Replies: 3
    Last Post: 01-19-2011, 07:57 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
  •