Pass the name of a button into existing instance of a class from actionlist
I want to pass a name of a button from actionlistener that is associated with that button into existing instance of a class. I need to do so because I have array of buttons and I have set the name of the buttons as coordinates. Is there a way to do that?
My buttons are declared as JButton arrayOfButtons[][] = new JButton[numberOfRows][numberOfColumns];and I labeled them inside 2 for loops as:
arrayOfButtons[row][column].setName(Integer.toString(row) + " " + Integer.toString(column));
arrayOfButtons[row][column].setText("Some displayed text");I also added ActionListener
arrayOfButtons[row][column].addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println(((JButton)e.getSource()).getName());
});Now when I press a button it only displays the array coordinates on a command line. I want the class instance where I declared the buttons to get notified which button was clicked.
Similar Messages
-
Passing the name of a table to a procedure
Can anyone tell me how you can pass the name of a table to a procedure ?
I am trying to write a generic procedure that will have the table name and the fieldname passed to it :-
as in :-
Select Fieldname FROM Tablename;
nullRefere to the documentation of
built in package dbms_sql. -
How can i pass the name of the file polled by the file adapter to next step
Hi XI guru's ,
How can i pass the name of the file polled by the file adapter to next step in a BPM..?
regards,Use Adapter-Specific Message Attributes and map that value in udf to the BPM message.
Also see this
/people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
Regards,
Prateek -
Can we change the name of reassign button in sharepoint 2010 approval workflow?
can we change the name of reassign button in sharepoint 2010 approval workflow?
Shazil AliYes, we can change it. Steps are as follows: 1. Create the workflow in SharePoint Designer 2010 2. Use Start Approval Process action 3. Write your logic and all setting as per you requirement and then publish the workflow once. 4. After this, click on
the workflow name and there you will see the sections as Workflow Information, Customization, Settings, Start Options, Forms. Here you will see a form under Forms section with a name of Approval_x00....... with a type "Task". Click on this form. This form
is an Infopath form that opens up when a task is to be edited (Task Form). This form will open up in Infopath (provided you have Infopath installed on your system) It may ask you the crendentials for security. 5. The task form will open up in Infopath for
editing. Click on the Reasign button and in the top left corner in the ribbon section is the field (Label) having text as "Reassign Task". Change this and then save and publish the form.Publish the workflow once again. -
Display the name of a button when mouse moves over it
when a mouse moves over a button i want the name of the label to be displayed at the tip of the mouse...like we have in microsoft word and other applications...how do i do that??
Its called a Tooltip. Now that you knoow that, search the API for a suitable method to invoke to set the Tooltip text.
luck, db -
<blockquote>Locking duplicate thread.<br>
Please continue here: [[/questions/927506]]</blockquote>
I'm just curious if the creators of a theme can get access into your computer or get info from it if you use the theme?From [https://addons.mozilla.org/faq Add-ons for Firefox > Frequently Asked Questions]:
'''Are add-ons safe to install?'''<br>
Unless clearly marked otherwise, add-ons available from this gallery have been checked and approved by Mozilla's team of editors and are safe to install. We recommend that you only install approved add-ons. If you wish to install unapproved add-ons or add-ons from third-party websites, use caution as these add-ons may harm your computer or violate your privacy. [https://addons.mozilla.org/developers/docs/policies/reviews Learn more about our approval process]
'''What does it mean if an add-on is "experimental" or "preliminarily reviewed"?'''<br>
Experimental add-ons have been checked by our editors to make sure they don't have security problems, but they may still have bugs or not work properly. Use caution when installing experimental add-ons and uninstall the add-on immediately if you notice problems. [https://addons.mozilla.org/developers/docs/policies/reviews Learn more about our review process]
'''What does it mean if an add-on is "not reviewed"?'''<br>
While all add-ons publicly available in our gallery are reviewed by an editor, you may receive a direct link to an add-on that hasn't yet been reviewed. Use caution when installing these add-ons, as they could harm your computer or violate your privacy. We recommend that you only install reviewed add-ons. [https://addons.mozilla.org/developers/docs/policies/reviews Learn more about our review process]
''Tylerdowner wrote:''
Just a theme, no, I don't believe so.
It's incorrect to suggest that a theme doesn't have the same technical capabilities. Go look at the plethora of themes that are bundled with an extension, e.g. Silvermel, Charamel, Oxygen KDE, etc. -
Hi!
Sorry, I'm lost. I just started to wonder, what are these buttons for:
http://postimg.org/image/vryd2es2f/
(Sorry, but the file upload pop up is not working for since weeks...)
I've no clue, how to search for it, as I do not know, how to name these buttons.
Thanks!Thanks a lot!
Thanks to you, I found a short in the (German) manual:
Photoshop-Hilfe | Malwerkzeuge
Ans also in the English one:
http://helpx.adobe.com/photoshop/using/painting-tools.html -
Change the name of decision button in SWBP
Hi ,
I copied the standard workflow. I Want to change the button name when it appears in SWBP.
Currently is says, "Sent back for corrections" i need to change it to "Rejected".
I went to the task -> outcome and change NAme field. I ran SWU_OBUF but the new desctiption is not getting effected any ideas on what am doing wrong or what i need to do?
thanks youHello,
The change will only take effect for workitems created after the change.
Also, you have to change the value in the Decision tab, not the Outcomes tab.
regards
Rick Bakker
hanabi technology -
Passing movieClip names to different buttons/MCs
I have 5 MCs on stage, acting as buttons (ChoiceA_mc to
ChoiceE_mc) - referred to in a loop (instead of individually naming
them). I have to disable all these MCs when one has been pressed
& reactivate them when the 'Next Question' button is pressed.
My script works but I think there is a much more efficient way of
doing it - so I don't have to repeat the 'for' loop 3 times.
I'd be grateful if anyone can show me a more efficient way of
doing this. Script is :
next_btn._alpha = 20;
next_btn.enabled = false;
// define content and actions for each answer button:
var choice:String;
for (var i = 65; i<=69; i++) {
choice = "choice"+String.fromCharCode(i)+"_mc";
this[choice].letter_txt.text = String.fromCharCode(i);
this[choice].id = String.fromCharCode(i);
// when this answer is chosen:
_root[choice].onRelease = function() {
for (i=65; i<=69; i++) {
var allButts:MovieClip =
this._parent["choice"+String.fromCharCode(i)+"_mc"];
allButts.enabled = false;
allButts.gotoAndStop("_up");
next_btn._alpha = 100;
next_btn.enabled = true;
next_btn.onRelease = function() {
this._alpha = 20;
this.enabled = false;
//show all 5 answer btns again:
for (i=65; i<=69; i++) {
allButts =
this._parent["choice"+String.fromCharCode(i)+"_mc"];
allButts.enabled = true;
};you can do something like that:
public someClass {
someOtherClass obj;
public someclass (someOtherClass object) {
this.obj = object;
public void someMethod () {
if (condition) { obj.someOtherMethod(); }
public someOtherClass {
//constructor here
public void someOtherMethod () { //do Stuff }
like this you could pass values between your classes A, B and C -
Hi Expert team
please give me solution as soon as possibleThank you for your reply, Paul. Unfortunately this suggestion didn't solve the issue.
After experimenting with it for a bit, it seemed that it might be related to widow/orphan control, but it occurs even with widow/orphan control turned off.
Does anyone out there have any suggestions?
Thanks,
Jason -
Why the event not added automatic into ical when receive a meeting from outlook?
Hi,
I'm using ical 4.0.4 and when I receive a meeting from outlook, there is no event added into ical. However, in my ios device, it works pretty well.
Could anyone help me? Whether this is the issue of the ical(version 4.0.4)?
Thank you.
p.s.It works well in ical versions which are higher than 4.0.4.Hi,
I'm using ical 4.0.4 and when I receive a meeting from outlook, there is no event added into ical. However, in my ios device, it works pretty well.
Could anyone help me? Whether this is the issue of the ical(version 4.0.4)?
Thank you.
p.s.It works well in ical versions which are higher than 4.0.4. -
Create an instance of a class from class name
Hi,
I have the class name as a String variable. I need to create an instance from this class. How to do it in Java?
Thanks and regards, MarinaHello
see
[http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#forName(java.lang.String)]
and
[http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#newInstance()]
for Classes with paramterless constructor
or
[http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Constructor.html#newInstance(java.lang.Object[])]
for Constructor with parameters
regards franz -
Passing the database name as a PL/SQL procedure parameter
How do I pass the name of the database as a parameter to a procedure?
If dbs is the variable name to which I pass the database name as shown in the example,
CREATE OR REPLACE PROCEDURE Extract_gl_acct_Tbl(dbs varchar2)
and I use dbs in the code as follows,
SELECT ACCOUNT,
SETID
FROM SYSADM.PS_GL_ACCOUNT_TBL@dbs
It gives me an error saying 'ORA-04054: database link DBS does not exist'.You will need to use dynamic SQL to handle this:
create or replace ...
is
type rc is ref cursor;
v_rc rc;
begin
open v_rc for 'select ... from sysadm.ps_gl_account_tbl@' || dbs;
fetch v_rc into ... -- some variables
-- if multiple rows, you'll need to do the fetch in a loop and exit when v_rc%notfound.
close v_rc;
end; -
Passing field name into Cursor
I would like to pass the name of a field for the WHERE clause, into a cursor. In my application I need to change the field name for the where clause. I get an "Invalid Number" error when I try the following:
cursor l_sel2Cur (c_group varchar2)
is
select email from test_grp_tbl6 where c_group = 1;
select column_name
into l_colName
from listserv_grp_lk
where lg_id = v_listserv_grp;
open l_sel2Cur(l_colName);
I hope this is enough explanation. I have seen examples where the value for the where clause is passed in, but not where the field name itself is passed in. Is this possible?
Thanks in advance,
JohnSee the following example:
SQL> create or replace procedure print_enames(in_col in varchar, in_val in varchar2) is
2 c sys_refcursor;
3 v_name emp.ename%type;
4 begin
5 open c for 'select ename from emp where '||in_col||'='''||in_val||'''';
6 loop
7 fetch c into v_name;
8 exit when c%notfound;
9 dbms_output.put_line('ename='||v_name);
10 end loop;
11 end;
12 /
Procedure created.
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
14 rows selected.
SQL> set serverout on
SQL> exec print_enames('mgr','7839')
ename=JONES
ename=BLAKE
ename=CLARK
PL/SQL procedure successfully completed.
SQL> exec print_enames('sal','1250')
ename=WARD
ename=MARTIN
PL/SQL procedure successfully completed.
SQL> exec print_enames('deptno','30')
ename=ALLEN
ename=WARD
ename=MARTIN
ename=BLAKE
ename=TURNER
ename=JAMES
PL/SQL procedure successfully completed. -
How can I pass the web template name dynamically to a container
Hi Experts ,
I have a container web item in 7.0
I would like to pass the name of the web template to be displayed in that web item dynamically .
how can I achieve the same .
How can i change the visibility settings of a container using a javascript .
Thanks in advance for your help .
Regards
NikhilHi Nikhil,
When you say that you want to display the name of the template for the container item, I think you are talking about the tray caption for the item - is that correct? You can use a text item to access the web template name, but in the caption of the container item, you cannot specify other web items.
What you can do it to use a group item in the template and embed your container layout in it. In the group item, you have an option of specifying a caption using another web item where you can reference this text item.
Maybe you are looking for
-
I bought a song on iTunes and it started downloading but then about half way through it seemed to stop downloading so I pressed the square stop button in he middle of the downloading circle so that I could try and restart the download. But when I wen
-
Chart legend too wide when using horizontal layout
I am using a flex chart with about 15 series on it. I've set the legend direction variable to "horizontal". However since the panel width which contains the chart is fixed, the legend sprawls out to the right instead of going "wrapping around" nicely
-
Hi, I am using a if condition that will first check if the above command ran successfully if the errorlevel is 0 then execute the condition inside the if condition. My syntax is as follows if %errorlevel%==0 ( for /f "delims=" %%x in ('dir /b/od C:\F
-
Is it okay to use a battery replacement that's 0.3V higher than the original battery?
My PA5024U-1BRS (10.8 V) Toshiba battery for my Satellite M840 got broken so I bought a new one from Toshiba but they gave me PA5025U-1BRS (11.1 V) which has a 0.3 V difference. When I ask Toshiba's technical staff if it's compatible with my laptop t
-
Hi Masters, I am working on Oracle Text. I have executed the below step/commands. All are executed successfully. But I didn't seen any improvement in my task. But I have one doubt, will explain below. create table ent_dnt as select * from entitlement