Changing Fonts in Java TextField.

A

Antoni

Hello,

I just wondered if anyone had an a Java example which demonstrated the
editing of text in a JTextfield.

I was hoping to include a font button, font size and buttons to
underline and bold the JTextField content.

Thanks
 
A

Andrew Thompson

I just wondered if anyone had an a Java example which demonstrated the
editing of text in a JTextfield.

I take it you mean the font face,
font size, italic, bold?

Rather than 'cat' -> 'mat'?
I was hoping to include a font button, font size and buttons to
underline and bold the JTextField content.

JTextFields are not designed for formatted data
and the user would find it quite disconcerting.
If you want such effects it is often better to
do them in a component like JEditorPane, or
JLabel, either of which can accept <HTML>.

HTH

Oh, and BTW.. these guys are hacks
when it comes to GUI's, see instead..
<http://www.physci.org/codes/javafaq.jsp#cljg> ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top