wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Similar Threads
removing sysmenu items
How to deactivate close, minimise and resizable from a window say frame?
Displaying the close,min and max button on the left of JFrame
How to change the shape of the JFrame to a custom look
Why JDialog display Max/Min buttons in linux and windows does not?