From: tvojeho <tv...@us...> - 2012-07-24 12:30:49
|
That works great, Jarek. I have googled a little and put together this: ToolTip(String Text, int X, int Y, long milliseconds) { Runnable r = new Runnable() { public void run() { // ... code to be executed ... JWindow note = new JWindow(); .... note.dispose(); } }; Thread thr1 = new Thread(r); thr1.start(); } ToolTip("tooltip text", 0, 0, 5000); but I was not sure what to do with the thread I started - should it be properly closed or what? Your code is much better. tvojeho 2012/7/24 Jarek Czekalski <jar...@po...> > W dniu 2012-07-24 12:56, tvojeho pisze: > > Thanks Jarek, I will investigate and see what comes up. It seems like > > what I need. The status bar message I know about, but that is not what > > I wanted. > > So you definitely need a background execution, but it can be made very > simple (see below). It works although is not 100% correct, because AWT > calls should be wrapped into something like EventQueue.invokeLater. For > home application it is not necessary. > > class ToolTip { > public static void toolTip(String Text, int X, int Y, long milliseconds) > { > ThreadUtilities.runInBackground(new Runnable() { public void run() { > JWindow note = new JWindow(); > ... > note.dispose(); > }}); > } > } > > ToolTip.toolTip("tooltip text", 0, 0, 1000); > > You're welcome! > Jarek > > > > > > Regards, tvojeho > > > > 2012/7/24 Matthieu Casanova <cho...@gm... > > <mailto:cho...@gm...>> > > > > Hi, to write something in the status bar it is: > > > > view.getStatus().setMessage("hello"); > > > > > > 2012/7/24 Jarek Czekalski <jar...@po... > > <mailto:jar...@po...>> > > > > > > W dniu 2012-07-24 07:19, tvojeho pisze: > > > Hi, I was trying to put together a tooltip function for my > jedit > > > macros so I could have a different way of notification than the > > > classic message box, but I am stuck. > > > > Maybe status bar? There must be some api that is used for > > example by > > sidekick to show highlighted item name. > > > > > > > > - unless I put a message box before the sleep command, I do > > not even > > > see the tooltip > > > - during the sleep period jedit is unresponsive > > > > > > I am no java programmer - I think that my problem might be > > solved by > > > using different threads, but it goes over my head. Any help > > would be > > > appreciated. > > > > You may need a new Runnable class runned by for example > > ThreadUtilities.runInBackground that will be given the note > > and will > > sleep and switch it off. > > > > Jarek > > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. > > Discussions > > will include endpoint security, mobile security and the latest > > in malware > > threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > -- > > ----------------------------------------------- > > jEdit Users' List > > jEd...@li... > > <mailto:jEd...@li...> > > https://lists.sourceforge.net/lists/listinfo/jedit-users > > > > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. > > Discussions > > will include endpoint security, mobile security and the latest in > > malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > -- > > ----------------------------------------------- > > jEdit Users' List > > jEd...@li... > > <mailto:jEd...@li...> > > https://lists.sourceforge.net/lists/listinfo/jedit-users > > > > > > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > > > > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > -- > ----------------------------------------------- > jEdit Users' List > jEd...@li... > https://lists.sourceforge.net/lists/listinfo/jedit-users > |