-
August 3rd, 2009, 03:43 AM
#1
JTextArea line (not border) around rect
In my application I added a JTextArea, and though I set the Border to Empty Border or null, a blue line always surrounds the rect of the JTextArea. I think it's not the border because I tried to set a border for the JTextArea and the blue line was incide the border and still visible. Can someone help me how to remove this line? Thank you very much
P.S. I'm using Netbaens 6.1 GUI Builder to build the UI of my application. Thanks again
Last edited by iron59; August 3rd, 2009 at 03:49 AM.
Reason: Additional Info
-
August 3rd, 2009, 06:36 AM
#2
Re: JTextArea line (not border) around rect
Are you sure this isn't the focus marker? If it is then the line will disappear as soon as the focus shifts to another component.
-
August 3rd, 2009, 06:43 AM
#3
Re: JTextArea line (not border) around rect
Originally Posted by keang
Are you sure this isn't the focus marker? If it is then the line will disappear as soon as the focus shifts to another component.
I don't think so. I have two JTextArea and the were both painted this way
-
August 3rd, 2009, 08:42 AM
#4
Re: JTextArea line (not border) around rect
Could it have something to do with the gui builder, or layout manager? Some managers have internal debug states that eg. draw a grid around the components getBounds().
-
August 3rd, 2009, 08:02 PM
#5
Re: JTextArea line (not border) around rect
Originally Posted by Londbrok
Could it have something to do with the gui builder, or layout manager? Some managers have internal debug states that eg. draw a grid around the components getBounds().
If that's the case is there a way to remove it?
-
August 4th, 2009, 04:31 AM
#6
Re: JTextArea line (not border) around rect
Would not know how to remove, I do not use netbeans myself and have thus no idea of the respective gui builder. Debug state would sound sensible a thing in a gui builder though.
-
August 4th, 2009, 04:41 AM
#7
Re: JTextArea line (not border) around rect
Originally Posted by Londbrok
Would not know how to remove, I do not use netbeans myself and have thus no idea of the respective gui builder. Debug state would sound sensible a thing in a gui builder though.
Sorry I did not what you mean by debug state. I'll run the application in Debug mode? Well I think I'll try to create a renderer for my JTextArea, I hope this works, but I'm still open for suggestions
-
August 4th, 2009, 07:05 AM
#8
Re: JTextArea line (not border) around rect
What Londbrok was saying was that the GUI Builder itself might be adding the line so you can see the bounds of the component. If this is the case, it is purely for debug purposes and the lines will not appear when you run the application outside of NetBeans. Also there will almost certainly be a switch you can set to stop these lines showing in NetBeans and it will be possibly be called something like "debug mode", "hide/show bounds" etc.
What OS and what Look and Feel are you using?
You will almost certainly not need to create your own renderer to get this to display properly.
-
August 5th, 2009, 07:29 PM
#9
Re: JTextArea line (not border) around rect
The LookAndFeel I'm using right now is the one used by the OS. Now I get what you're trying to say. Thank you very much very much for the clraification. I'll try to look for options and I'll also try to run the program outside Netbeans. If one of these will work, it will save me time creatin my own renderer. I just think its weird thst in Netbeans, this only applies to the JTextArea component. I'll update this thread for progress. Thanks again
-
August 5th, 2009, 10:17 PM
#10
Re: JTextArea line (not border) around rect
I finally figured it out. Netbeans automatically creates a JScrollpane for the textarea and that's where the border comes from. i'm really sorry for my stupidity
-
August 6th, 2009, 03:05 AM
#11
Re: JTextArea line (not border) around rect
Automatic scrollpane is not a bad thing. You can get rid of the extra border by setting setBorder(null) on the JScrollPane instance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|