Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3920

Re: setAccelerator method

From "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this>
Subject Re: setAccelerator method
Message-ID <g7e219$iq2$1@registered.motzarella.org> (permalink)
Newsgroups comp.lang.java.gui
References <c905d0df-3b95-46a9-a2da-bf66e06a177a@v39g2000pro.googlegroups.com>
Date 2011-04-27 15:47 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On 07/08/2008 07:20, sundarmcakms@gmail.com allegedly wrote:
> 1)  i want to set shortcut for a menu item. ctrl+any alpahabet but
> when i use this type of passing arguments
> mf_new.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,KeyEvent.VK_CONTROL));
> i got it as shift+n
> when i use this type of passing arguments
> mf_open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_CONTROL,KeyEvent.VK_O));
> i got meta+shift+alt+ctrl+.... and so on..

Read the fine manual:
http://java.sun.com/javase/6/docs/api/javax/swing/KeyStroke.html#getKeyStroke(int,%20int)


> 2) in a jframe class i have a jtextarea and implemented textListener
> i have given various possibilities like
> addTextListener()
> ta.addTextListener()
> ta.addTextListener(this)
> this.addTextListener(ta)
> addTextListener()
> 
> but it is coming error when i compile it...

That's too bad.

Try an SSCCE:
  http://www.pscode.org/sscce.html

-- 
DF.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

setAccelerator method and sundarmcakms@gmail.com.remove-dii-this - 2011-04-27 15:47 +0000
  Re: setAccelerator method "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000

csiph-web