Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: JavaBean property TextPosition

  1. #1
    Junior Member
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default JavaBean property TextPosition

    I have a bean with a couple components, one of which is a JLabel. I'm trying to create a property which allows the user to edit the horizontal and vertical text position. I can enter integers in the property, but I would like to present the user with Top, Bottom, Center, Leading... I can probably figure this out if someone points me in the right direction.


  2. #2
    Junior Member
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: JavaBean property TextPosition

    Anyone? Should I post this question somewhere else?

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,264
    Thanks
    176
    Thanked 821 Times in 764 Posts
    Blog Entries
    5

    Default Re: JavaBean property TextPosition

    Can you clarify your question a bit, perhaps post a short example code? Do you just wish to modify the position of the text within a JLabel?

  4. #4
    Junior Member
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: JavaBean property TextPosition

    Yes, I want to modify the position of the text within a JLabel. So for the set and get functions of my bean I want have the option to select leading, center, or trailing in the horizontal text postion proptery. Right now I can only pass ints.

    public void setTextHorizontalAlignment(int align)
    {
        textHorizontalAlignment = align;
    }
     
    public int getTextHorizontalAlignment()
    {
        return textHorizontalAlignment;
    }

  5. #5
    Junior Member
    Join Date
    Jul 2010
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: JavaBean property TextPosition

    bump for answer

Similar Threads

  1. Accessing Properties File
    By java_mein in forum Java Servlet
    Replies: 5
    Last Post: May 14th, 2010, 02:44 AM