Results 1 to 6 of 6
  1. #1
    LetsG0Blue is offline Member
    Join Date
    Feb 2013
    Posts
    68
    Rep Power
    0

    Default Creating a border in Java GUI

    I need to make a red border around my program, but I don't have a clue how to start on it. I've tried to mess around with drawRec, but I didn't have much luck.

    Could anyone point me in the right direction?

    Creating a border in Java GUI-graphingassignment.png

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

    Default Re: Creating a border in Java GUI

    Have you tried setBorder()? See also --> BorderFactory (Java Platform SE 7 )

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

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Creating a border in Java GUI

    Quote Originally Posted by jim829 View Post
    Have you tried setBorder()?
    That's assuming this is Swing. But AWT/Swing doesn't have a drawRec method ...

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

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

    Default Re: Creating a border in Java GUI

    I first assumed the OP just made a typo since there was no mention of any compile or runtime errors. And due to lack of any code I figured the OP would provide more detail if the setBorder didn't work or wasn't available. Following your lead, for all we know, this could be for an Android.

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

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Creating a border in Java GUI

    Not with that title bar, no. But it just might be SWT or FX.

    Oh, and if I wanted a red border around my program, I would copy the code to a word processor and do it there :)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

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

    Default Re: Creating a border in Java GUI

    Wow! You don't miss a thing! I am really glad my font dots my i's and crosses my t's for me. ;)

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

Similar Threads

  1. Replies: 1
    Last Post: 03-05-2012, 10:44 AM
  2. Replies: 4
    Last Post: 10-17-2011, 08:09 PM
  3. Set border
    By anilkumar_vist in forum New To Java
    Replies: 1
    Last Post: 02-06-2010, 11:25 AM
  4. Border with LestCellRenderer
    By Gajesh Tripathi in forum AWT / Swing
    Replies: 5
    Last Post: 06-02-2009, 06:59 AM
  5. Border Layout
    By mark-mlt in forum Java Applets
    Replies: 5
    Last Post: 05-12-2008, 09:48 AM

Posting Permissions

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