This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes round JTextField/ making own min and max buttons Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "round JTextField/ making own min and max buttons" Watch "round JTextField/ making own min and max buttons" New topic
Author

round JTextField/ making own min and max buttons

Chris Dancy
Ranch Hand

Joined: Feb 14, 2006
Posts: 136
got a couple of quick questions if anyone can help me out. I want a JTextField with rounded corners. My Thought was to subclass JTextField and override paintComponent and just draw a roundRectangle, yet when i do this, the textfield turns to nothing...any ideas?

And second question, if i wanted to make my own min and max and close buttons in my frame, what do I over ride to do so?


("Anger is not an emotion, its a symptom of fear.")
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> I want a JTextField with rounded corners.

http://forum.java.sun.com/thread.jspa?forumID=57&threadID=260846

> if i wanted to make my own min and max and close buttons in my frame,

probably easier to frame.setUndecorated(true), then build your own button panel
and put it into BorderLayout.NORTH
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: round JTextField/ making own min and max buttons