Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-2007, 02:35 AM
Member
 
Join Date: Apr 2007
Location: Pennsylvania,USA
Posts: 46
sandor is on a distinguished road
Line break in tool tip..how??
I am trying to make a line break in my tooltip. It is the one that says
"Toggle line\n wrap" below. Will try to highlight it if I can figure out how.
Anyway, any ideas how to manage this? Obviously the \n is not doing it.
Code:
import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JToolBar; public class TestLines { private static final int PREFERRED_WIDTH=200; private static final int PREFERRED_HEIGHT=100; public TestLines() { JFrame frame = new JFrame("Test"); JToolBar toolbar= new JToolBar(); JButton saveButton = new JButton(" save "); saveButton.setToolTipText("Save"); toolbar.add(saveButton); JButton boldButton = new JButton("Bold"); boldButton.setToolTipText("Bold"); toolbar.add(boldButton); JButton linewrapbutton = new JButton("Line Wrap"); linewrapbutton.setToolTipText("Toggle line\n wrap"); toolbar.add(linewrapbutton); frame.getContentPane().add("North", toolbar); frame.pack(); frame.setSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); frame.setVisible(true); } /** * @param args */ public static void main(String[] args) { new TestLines(); } }

Last edited by sandor : 05-16-2007 at 02:42 AM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-16-2007, 02:45 AM
Member
 
Join Date: Apr 2007
Location: Indiana
Posts: 84
pegitha is on a distinguished road
Send a message via Skype™ to pegitha
Try using html
Code:
linewrapbutton.setToolTipText("<html>Toggle line<br> wrap</br></html>");
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Project management tool Sudha New To Java 0 01-23-2008 08:56 PM
Java SQL Admin Tool 2.4.2 JavaBean Java Announcements 0 11-12-2007 07:05 PM
SPT Relational Database Web Tool 1.2 JavaBean Java Announcements 0 11-10-2007 07:40 PM
Reading in data from file line by line bluekswing New To Java 1 10-02-2007 01:19 AM
Swing Tool Nick15 AWT / Swing 2 05-05-2007 06:45 PM


All times are GMT +3. The time now is 01:03 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org