• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

jTextField default border color

 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using java6 and all defaults, i've textfields and a jTextArea; as the default textarea has no border, i added one; but i cant find out what color textfield's borders use, so that i could use the same color in my textarea border.

how can i find that out?

TiA
[ March 30, 2007: Message edited by: miguel lisboa ]
 
Marshal
Posts: 65113
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go through the API specifications for whichever Border you are using. You should find methods which get the colour. They are there in LineBorder and EtchedBorder.
 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the closest i got:

gets an error msg:


Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.BorderUIResource$CompoundBorderUIResource cannot be cast to javax.swing.border.LineBorder

 
miguel lisboa
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dont even need to know the color:


 
Campbell Ritchie
Marshal
Posts: 65113
247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!