How to add tooltip to jframe title?

hi all
does anyone knows how can i set tooltip for jframe title?
thanks

Since it's a slow Saturday and I'm in a good mood...import darrylbu.util.SwingUtils;
import javax.swing.*;
public class FrameTitleToolTip {
   public static void main(String[] args) {
      JFrame.setDefaultLookAndFeelDecorated(true);
      SwingUtilities.invokeLater(new Runnable() {
         @Override
         public void run() {
            new FrameTitleToolTip().makeUI();
   public void makeUI() {
      JFrame frame = new JFrame();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setSize(400, 400);
      for (JComponent component : SwingUtils.getDescendantsOfType(JComponent.class,
            frame)) {
         if (component.getClass().getName().contains("MetalTitlePane")) {
            component.setToolTipText("Tooltip for frame title bar");
            break;
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
}You can get the SwingUtils class [_here_|http://tips4java.wordpress.com/2008/11/13/swing-utils/]
db

Similar Messages

  • How to add tooltip to images?

    How to add tooltips to images?

    OK, here is a more robust, more generic (any node) implementation.
    It would be nice if I could find a way to automatically insert the tooltips in the scene, but at time of node with tooltip creation, scene doesn't exist yet... Should have a post-layout event, perhaps. Or I can do that once on the onMouseEntered event, but then I have to find a way to get the scene holding a given node. Tried to iterate on Parents, but I can't cast a Parent to a Scene?
    Anyway, here is the new code:
    Tooltip.fx
    public class Tooltip extends CustomNode
      public var text: String;
      public var fill: Paint = Color.web('#EEFF00');
      public var stroke: Paint = Color.GREEN;
      var label: Label; // Make public to access textOverrun, textWrap, etc.?
      var back: Rectangle;
      override function create(): Node
        label = Label
          text: text
        back = Rectangle
          x: -2, y: -1
          width:  label.width + 4
          height: label.height + 2
          fill:   fill
          stroke: stroke
        Group
          content: [ back, label ]
      init
        visible = false;
        layoutInfo.managed = false;
    WithTooltip.fx
    public mixin class WithTooltip
      /** The tooltip to display. */
      public var tooltip: Tooltip;
      // We display the tooltip after a while being over the node
      var tooltipTL = Timeline
        keyFrames: KeyFrame
          time: 750ms
          action: function ()
    //~         println("visible {%.0f tooltip.boundsInParent.minX} {%.0f tooltip.boundsInParent.minY}");
            tooltip.visible = true;
      var baseMouseMoved;
      var baseMouseEntered;
      var baseMouseExited;
      postinit
        var tooltipNode = this as Node;
        baseMouseMoved = tooltipNode.onMouseMoved;
        tooltipNode.onMouseMoved = function (evt: MouseEvent): Void
          if (not tooltip.visible)
            tooltip.translateX = evt.sceneX;
            tooltip.translateY = evt.sceneY - 20;
          baseMouseMoved(evt);
        baseMouseEntered = tooltipNode.onMouseEntered;
        tooltipNode.onMouseEntered = function (evt: MouseEvent): Void
    //~       println("onMouseEntered: {%.0f evt.sceneX} {%.0f evt.sceneY}");
          tooltipTL.playFromStart();
          baseMouseEntered(evt);
        baseMouseExited = tooltipNode.onMouseExited;
        tooltipNode.onMouseExited = function (evt: MouseEvent): Void
    //~       println("onMouseExited");
          tooltipTL.stop();
          tooltip.visible = false;
          baseMouseExited(evt);
    SomeStage.fx
    class ImageWithTooltip extends ImageView, WithTooltip
    var earthTT = Tooltip { text: "Mother Earth" }
    var earth = ImageWithTooltip
         image: Image { url: "{__DIR__}earth.png" }
         tooltip: earthTT;
    var mapTT = Tooltip { text: "General map of France" }
    var map = ImageWithTooltip
         image: Image { url: "{__DIR__}map.jpg", width: 200, preserveRatio: true }
         tooltip: mapTT;
    // Put the ImageWithTooltip nodes in layout if needed, put the Tooltip nodes at the end of the scene (on top, out of any layout).

  • How to add src, alt and title tags to a PS generated Web Photo Gallery

    I do some web design and need to add some tags to a web photo gallery created by Photoshop. Maybe this question should be directed to the GoLive / Dreamweaver Forum but since the gallery was created in PS I thought I'd start here.
    I need to add src, alt and title tags to the images in the web gallery. Normally this is as simple as working on the code in the html page in which the image sits but the PS gallery doesn't seem to be that simple.
    Can anyone tell me exactly how, and which files I need to work on, to add these tags to each of my 42 gallery images?
    Thanks.
    John.

    You can't do it in Photoshop.
    You can open the pages in a text editor adn easily ad any tags you want. They are simply html pages.
    If you really want to, you can use Dreamweaver or Golive. Using a text editor is generally faster and easier because you can just copy/paste between the files and not have to worry about code rewriting in the WYSIWYG applications. Don't believe the GoLive/Dreamweaver hype about "round trip code" they both will alter code.

  • How to add tooltip on dashboard

    Hi all,
    How can I add tooltip on Dashboard (shown in picture)? I have tried this by adding Comment on dashboard while creating it. But It did not show comment just name of dashboard in tootip.
    http://img686.imageshack.us/img686/5295/tooltip.png
    Thanks all

    Hi
    Add description in Description field, of properties for dashboard.
    Regards
    Kishore Guggilla

  • Add image to JFrame title?

    Hi, everybody
    Can i add a image to JFrame title by side right system menu?
    Thanks for your advice

    Prior to JDK 1.4 you can't without using native code.
    This is because the frame's title is displayed by the native windowing system.
    All you could do is use JWindow instead of JFrame and draw the decorations yourself completely. This can have other disadvantages besides the amount of work, like for example the window not showing up in the task bar on Windows systems.
    Using Merlin (1.4, currently in Beta) you can tell the frame to manage the title from the Java side using JFrame.setLookAndFeelDecorated(true).
    In that case the title bar is a subclass of JPanel (class name is called something like BasicTitlePaneUI, look it up yourself) and you could add anything you like to it.
    Hope it helps, Stephen

  • How to add Tooltip to the Iview name.

    hi all,
         I have to add tooltips to the iview name. When I bring the mouse over the iview
         name a message should display as the tooltip describing the purpose of the
         iview I am not able to found the tooltip option in the iview properties.
         Is there any coding involved for tooltips option or any other options available.
         Please guide me. Looking for the fast reply.
         Thanks in advance.
    Ponnusamy.P

    hi Deepti,
         When I gave the descripition, tool tip appears in the
         Content Admin -> Portal Content -> (Under the folder I have created the Iview).
         But the tool tips should appear in the iview when I display that iview to the end
         user.How to make that possible.
    Thanks
    Ponnusamy P

  • How to add Field in Page Title or repeat header on each print page.

    Hi Guys,
    We are using Application Express 4.1.0.00.32 on Wondows XP and Oracle version is 10g.
    I've created a report in APEX and the user is insisting on putting a header on each page in PRINT of the report which should contain the "from date" and "to date", which are present on the select criteria on top.
    Now I'm wondering, how can I implement this request?
    Can I somehow add from_date and to_date items in Title so that when they print the report, they'll see the from and to dates in the title?
    Or is there someother way to do this.
    The report is an interactive report with a control break and user prints the report with file->print.
    Please help me. I'd really appreciate your help.
    Thanks in Advance.

    Hi Guys,
    Nobody responded, so seems like there is no soluion for this in APEX.

  • How to Add Centered Dot in Title?

    My title says "MAY 3, 2010  .   LONG ISLAND, NY".
    But I want that little dot between the date and place to be centered vertically. I can't find any symbols. How's it done?

    Hey Bill
    You might also want to visit Martinique in the Caribbean.
    You'll experience all the island has to offer, including the best French wines.
    Needless to say, I'll be only to glad to show you around.
    You definitely need to take a break from posting on the Adobe forums.
    25,200 and counting.

  • How to add tooltip to pie chart?

    Hello forum,
    can I show a tooltip on mouse hover on pie of chart?
    Thanks in advanced

    Solved.
    For each data:
    Tooltip toolTip = new Tooltip();
    toolTip.install(data.getNode(), toolTip);
    toolTip.setText(data.getPieValue() + "%");

  • Add a Button in JFrame Title Bar

    How can I add a button in JFrame Title Bar. I want to put on more button for docking after the closing button in the title bar.

    if you use JFrame.setDefaultLookAndFeelDecorated(true) then you can do it by extending the JRootPaneUI class of the L&F (the default is the metal L&F). that is not a easy task but if you want take a look at BasicRootPaneUI, there you will have to point it to a new TitlePane which you will have to create. to load all this you must use the UIManager class. if you need more explaination try reading on look and feel and customizing it.

  • HT2523 How do I add shadow to the title of a document while in Pages? For instance: NEW YEAR'S NEEDS. I'm also at a loss to know how to create a folder for certain types of documents such as "Sermons" or "Lessons."

    How do I add shadow to a title, such as, NEW YEAR'S NEEDS, while in Pages? I also don't know how to set a new folder for documents of the same type such as, "Sermons," or "Lessons." Any help will be greatly appreciated.
    Donnie

    Yes, I very well may be over thinking this, but I tried duplicating and moving it, but the text distorts slightly, which can be mostly remedied by rotating it on the x-axis, although the light is still off. And the shadows and reflections are not visible - this is pic1... In pic2, I used "rotate 3d object" with the green and red arrows,  instead of just sliding it up the y-axis using the coordinates in the scene tab. Using the green and red arrows to move the text preserved the reflections but the shadows now aren't visible. It was also hard to align the text perfectly in scenario 2. Thanks for the help

  • How to add a table(from TableRenderDemo) to a JFrame again

    Hello again:
    Thanks for stephen andrews's adivice, I follow your adivice to add code (it is in
    EventHandeler of DrawCalendar class, and they indicated by ???????????), but it still not work, please check for me why, Thanks.
    My problem
    Please run my coding first, and get some view from my coding.
    At the movement, I got a problem, I have not idea how to add a table(it is from TableRenderDemo) to JFrame when I click on the button(from DrawCalendar) of the numer 20, and I want the table disply under the buttons(from DrawCalendar).
    Please help me to solve this problem, thanks.
    *This program for add some buttons and a table on JFrame
    import java.awt.*;
    import javax.swing.*;public class TestMain extends JFrame{
    private static TableRenderDemo tRD;
    private static TestMain tM;
    protected static Container c;
    private static DrawCalendar dC;
    public static void main(String[] args){
    tM = new TestMain();
    tM.setVisible(true);
         public TestMain(){
         super(" Test");
         setSize(800,600);
    //set up layoutManager
    c=getContentPane();
    c.setLayout ( new GridLayout(3,1));
    tRD=new TableRenderDemo();
    dC=new DrawCalendar();
    addItems();//add Buttons to JFrame
    private void addItems(){
         c.add(dC); //add Buttons to JFrame
         //c.add(tRD); //add Table to JFrame     
    *This program for add some buttons to JPanel
    *and add listeners to each button
    *I want to display myTable under the buttons,
    *when I click on number 20, but why it doesn't
    *work, The coding for these part are indicated by ??????????????
    [import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.GridLayout;
    public class DrawCalendar extends JPanel {
         private static DrawCalendar dC;
         private static TestMain tM;
         private static TableRenderDemo myTable;
         private static GridLayout gL;
         private static final int nlen = 35;
        private static String names[] = new String[nlen];
    private static JButton buttons[] = new JButton[nlen];
         public DrawCalendar(){
              gL=new GridLayout(5,7,0,0);
              setLayout(gL);
              assignValues();
              addJButton();
              registerListener();
    //assign values to each button
         private void assignValues(){
              names = new String[35];
         for(int i = 0; i < names.length; i++)
         names[i] = Integer.toString(i + 1);
    //create buttons and add them to Jpanel
    private void addJButton(){
         buttons=new JButton[names.length];
         for (int i=0; i<names.length; i++){
         buttons=new JButton(names[i]);
         buttons[i].setBorder(null);
         buttons[i].setBackground(Color.white);
         buttons[i].setFont(new Font ("Palatino", 0,8));
    add(buttons[i]);
    //add listeners to each button
    private void registerListener(){
         for(int i=0; i<35; i++)
              buttons[i].addActionListener(new EventHandler());          
    //I want to display myTable under the buttons,
    //when I click on number 20, but why it doesn't
    //work
    private class EventHandler implements ActionListener{
         public void actionPerformed(ActionEvent e){
         for(int i=0; i<35; i++){
         if(i==20){                  //????????????????????
              tM=new TestMain(); //I want to display myTable under the buttons,
              tM.c.removeAll(); //when I click on number 20, but why it doesn't
              tM.c.add(dC); //work
              tM.c.add(myTable); //???????????????????????????????????????
              tM.validate();
         if(e.getSource()==buttons[i]){
         System.out.println("testing " + names[i]);
         break;
    *This program create a table with some data
    [import javax.swing.table.AbstractTableModel;
    import javax.swing.table.TableColumn;
    import javax.swing.DefaultCellEditor;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.DefaultTableCellRenderer;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TableRenderDemo extends JScrollPane {
        private boolean DEBUG = true;
        public TableRenderDemo() {
          //  super("TableRenderDemo");
            MyTableModel myModel = new MyTableModel();
            JTable table = new JTable(myModel);
            table.setPreferredScrollableViewportSize(new Dimension(700, 70));//500,70
             //Create the scroll pane and add the table to it.
             setViewportView(table);
            //Set up column sizes.
            initColumnSizes(table, myModel);
            //Fiddle with the Sport column's cell editors/renderers.
            setUpSportColumn(table.getColumnModel().getColumn(2));
    * This method picks good column sizes.
    * If all column heads are wider than the column's cells'
    * contents, then you can just use column.sizeWidthToFit().
    private void initColumnSizes(JTable table, MyTableModel model) {
    TableColumn column = null;
    Component comp = null;
    int headerWidth = 0;
    int cellWidth = 0;
    Object[] longValues = model.longValues;
    for (int i = 0; i < 5; i++) {
    column = table.getColumnModel().getColumn(i);
    try {
    comp = column.getHeaderRenderer().
    getTableCellRendererComponent(
    null, column.getHeaderValue(),
    false, false, 0, 0);
    headerWidth = comp.getPreferredSize().width;
    } catch (NullPointerException e) {
    System.err.println("Null pointer exception!");
    System.err.println(" getHeaderRenderer returns null in 1.3.");
    System.err.println(" The replacement is getDefaultRenderer.");
    comp = table.getDefaultRenderer(model.getColumnClass(i)).
    getTableCellRendererComponent(
    table, longValues[i],
    false, false, 0, i);
    cellWidth = comp.getPreferredSize().width;
    if (DEBUG) {
    System.out.println("Initializing width of column "
    + i + ". "
    + "headerWidth = " + headerWidth
    + "; cellWidth = " + cellWidth);
    //XXX: Before Swing 1.1 Beta 2, use setMinWidth instead.
    column.setPreferredWidth(Math.max(headerWidth, cellWidth));
    public void setUpSportColumn(TableColumn sportColumn) {
    //Set up the editor for the sport cells.
    JComboBox comboBox = new JComboBox();
    comboBox.addItem("Snowboarding");
    comboBox.addItem("Rowing");
    comboBox.addItem("Chasing toddlers");
    comboBox.addItem("Speed reading");
    comboBox.addItem("Teaching high school");
    comboBox.addItem("None");
    sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
    //Set up tool tips for the sport cells.
    DefaultTableCellRenderer renderer =
    new DefaultTableCellRenderer();
    renderer.setToolTipText("Click for combo box");
    sportColumn.setCellRenderer(renderer);
    //Set up tool tip for the sport column header.
    TableCellRenderer headerRenderer = sportColumn.getHeaderRenderer();
    if (headerRenderer instanceof DefaultTableCellRenderer) {
    ((DefaultTableCellRenderer)headerRenderer).setToolTipText(
    "Click the sport to see a list of choices");
    class MyTableModel extends AbstractTableModel {
    final String[] columnNames = {"First Name",
    "Last Name",
    "Sport",
    "# of Years",
    "Vegetarian"};
    final Object[][] data = {
    {"Mary ", "Campione",
    "Snowboarding", new Integer(5), new Boolean(false)},
    {"Alison", "Huml",
    "Rowing", new Integer(3), new Boolean(true)},
    {"Kathy", "Walrath",
    "Chasing toddlers", new Integer(2), new Boolean(false)},
    {"Sharon", "Zakhour",
    "Speed reading", new Integer(20), new Boolean(true)},
    {"Angela", "Lih",
    "Teaching high school", new Integer(4), new Boolean(false)}
    public final Object[] longValues = {"Angela", "Andrews",
    "Teaching high school",
    new Integer(20), Boolean.TRUE};
    public int getColumnCount() {
    return columnNames.length;
    public int getRowCount() {
    return data.length;
    public String getColumnName(int col) {
    return columnNames[col];
    public Object getValueAt(int row, int col) {
    return data[row][col];
    * JTable uses this method to determine the default renderer/
    * editor for each cell. If we didn't implement this method,
    * then the last column would contain text ("true"/"false"),
    * rather than a check box.
    public Class getColumnClass(int c) {
    return getValueAt(0, c).getClass();
    * Don't need to implement this method unless your table's
    * editable.
    public boolean isCellEditable(int row, int col) {
    //Note that the data/cell address is constant,
    //no matter where the cell appears onscreen.
    if (col < 2) {
    return false;
    } else {
    return true;
    * Don't need to implement this method unless your table's
    * data can change.
    public void setValueAt(Object value, int row, int col) {
    if (DEBUG) {
    System.out.println("Setting value at " + row + "," + col
    + " to " + value
    + " (an instance of "
    + value.getClass() + ")");
    if (data[0][col] instanceof Integer
    && !(value instanceof Integer)) {
    //With JFC/Swing 1.1 and JDK 1.2, we need to create
    //an Integer from the value; otherwise, the column
    //switches to contain Strings. Starting with v 1.3,
    //the table automatically converts value to an Integer,
    //so you only need the code in the 'else' part of this
    //'if' block.
    try {
    data[row][col] = new Integer(value.toString());
    fireTableCellUpdated(row, col);
    } catch (NumberFormatException e) {
    JOptionPane.showMessageDialog(TableRenderDemo.this,
    "The \"" + getColumnName(col)
    + "\" column accepts only integer values.");
    } else {
    data[row][col] = value;
    fireTableCellUpdated(row, col);
    if (DEBUG) {
    System.out.println("New value of data:");
    printDebugData();
    private void printDebugData() {
    int numRows = getRowCount();
    int numCols = getColumnCount();
    for (int i=0; i < numRows; i++) {
    System.out.print(" row " + i + ":");
    for (int j=0; j < numCols; j++) {
    System.out.print(" " + data[i][j]);
    System.out.println();
    System.out.println("--------------------------");

    http://forum.java.sun.com/faq.jsp#format

  • How can add captions or title to a picture now that iPhoto doesn't work after updating to iOS 8.

    I Have updated to iOS 8 and iPhoto is dismissed. How can add a caption /title (not in the image) like I was used with iPhoto? Photos has not this feature.
    please, could anyone help me. I'm a real beginner. Thanks,

    I Have updated to iOS 8 and iPhoto is dismissed. How can add a caption /title (not in the image) like I was used with iPhoto? Photos has not this feature.
    please, could anyone help me. I'm a real beginner. Thanks,
    The photos.app does not (yet) have the option to add captions or tags. It is not possible right now. You can however search for the captions you added previously using the search field.  You can also search for album names.  So, as a work-around, put photos that should have the same caption into an album with a name like the caption.
    See:  Migrating from iPhoto for iOS to Photos on iOS 8
    You may want to send feedback to Apple, that captions and tags are essential and need to be added in an update. Use this form:   Apple - iPhoto - Feedback

  • How to add titles to multiple pictures at same time in iphoto11

    I am having difficulty navigating in iphoto11.
    Can not figure out how to add keywords to multiple photos
    or how to add the same title to multiple photos.

    Titles: Photos menu -> Batch Change.
    Keywords: Select a batch of pics. Apply keyword to one, it's applied to all
    Regards
    TD

  • How to add a Title (slide? screen?) BEFORE the video track

    Hello,
    I'm very new to Adobe Premiere Pro and I'm trying to figure out how to add a title to my project but I don't want the title on the start of the video in the sequence. I'd like to add it to a black screen, maybe with some transition effects, that will play prior to the video starting. Do I need to create a black image in CS and add it as a still and just add the title to the still which I can position before the video/audio track A starts?
    I'm hoping that there's something I can do right within Premiere that will give me a place to put the title before my video starts. I didn't see an option to add a blank slide or something to that effect that I can add title to.
    thanks for your assistance!
    The more I learn the more excited I get, this software is great.

    Thanks for the link.. like I said in my post, I'm brand new to the software and I've been watching and following guides for hours. Time is not on my side, I have a project that must be done by the end of this week and I have very limited time after work.
    So when I have the head at the begining of my main track and click INSERT in the source monitor window it inserts a duplicate of the entire video so I have TWO videos in my sequence. This is clearly not what I'm wanting so I'm assuming that there's something I'm missing. I've searched google but don't see anything.
    I'm just looking to add a black, blank screen that I can add a title to before my video begins. I realize this may be rudamentary to season vets but as I said, I'm very new and trying to learn this all quickly and I would really appreciate if someone could point me directly to some information about it. I'm not afraid to read and learn, hell I love it, but I'm pressed for time so someone just telling me, "go learn the software" with a link to a huge FAQ, doesn't really help me.
    I've already learned a ton from some great guides but I have yet to have anyone indicate how to add extra footage (be it a still or blank video) directly from Premiere Pro.
    Thank you all for your time!
    EDIT: I think I figured it out... I just bumped the start of the main track up about 10 seconds and I added new item "Black Screen" right in front of it. I will add the title to this. Thanks all.

Maybe you are looking for

  • I hate the new Z10, handing it over to my wife

    I am a Blackberry poweruser. I have Blackberry everywhere along with all accessoirs. The background is, that I am travelling with 4 phones, for every country I have businesses in one phone. I bought the Playbook, to have a quick online banking done a

  • IPhone 5 not charging

    About 4 days ago I went to plug my iPhone in to charge and it refused to charge. I tried many methods to get it working such as trying different mains sockets and using my MacBook Pro but nothing worked. I am using a genuine Apple lightning charger b

  • Import javax.servlet.jsp.*;

    I am new to JSP.I getting errors in compilation.Can anyone please tell me the following import file can be found in which development kit. "import javax.servlet.jsp.*;

  • Why is my screen recording blurry

    in quicktime screen recording the play back is blurry .How do i fix this?

  • Business Rule access issue

    Hi, I have newly set up few business rules in 9.3.1. I have two issues here. 1. No users listed :In Access Privileges tab,when I click on 'Add' to assign access to a user on this BR, there is only one user i.e admin(Internal) and no other users liste