Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Change Icon of Desktop Application?

829396Jun 1 2011 — edited Jun 2 2011
Friends, i am developing one small software using Java Desktop Application in Netbeans. I want to change the icon of my application (cup of coffee). I have tried this code: URL url = new URL("myApplication/resourcesresources/camera.png");
Toolkit kit = Toolkit.getDefaultToolkit();
Image img = kit.createImage(url);
this.getFrame().setIconImage(img);

and

URL url = new URL("F:/Documents and Settings/Selva/My Documents/NetBeansProjects/HashCodeCracker/src/myApplication/resourcesresources/camera.png");
Toolkit kit = Toolkit.getDefaultToolkit();
Image img = kit.createImage(url);
this.getFrame().setIconImage(img);

i have searched in google and nothing works . Can anyone solve this problem?

Note:
This code works for me:
Toolkit kit = Toolkit.getDefaultToolkit();
Image frameIcon = kit.getImage("F:\\Documents and Settings\\Selva\\My Documents\\NetBeansProjects\\HashCodeCracker\\src\\hashcodecracker\\resources\\PasswordCrackerIcon.jpg");
this.getFrame().setIconImage(frameIcon);

But i am creating software. So i can not specify the location of the Image in one path. The user may run the software from anywhere. So the above code can not be used.

Thanks

Edited by: Blackstar on Jun 1, 2011 8:46 PM

Comments

Mike Kutz

It looks like table TEST1 is being used as a temp table.
In Forms, this should probably have been a GTT.
GTTs don't work in APEX dye to Connection Pooling. You'd use a Collection instead.
But, I'm just guessing about the purpose of TEST1.
(PS - you should probably have just done an INSERT... SELECT instead of parsing a cursor in a loop)

SANPAT

Dear Mike Kutz
I want to delete all the old records from test1. then i want to update the table with the latest Query data from test table. can you suggest how to insert the records using the procedure in Oracle Apex .
Delete all Data from A Table
Query on Table B and get the data
Insert the Query data into A Table.
Sanjay

Mike Kutz
Answer

APEX is stateless. It automatically calls COMMIT as needed (or ROLLBACK ).
I'd keep it simple, Sanjay (K.I.S.S.)

BEGIN
  DELETE FROM TEST1;

  INSERT INTO TEST1 (empno,name)
    SELECT empno, name FROM EMPLOYEE;
END;
Marked as Answer by SANPAT · Oct 17 2021
SANPAT

Dear Mike Kutz
Thanks , your given Query is perfectly runing on Sql Command, but the same Query when i update in the Form at server side condition , it's not working . it truncate the data but not updating with fresh data from the called table.
image.png
image.pngKindly sugget .
Sanjay

AndyH

As you are running this from a Dynamic Action it will be running in a different database session to that of your page. If your page hasn't committed it's data, the session in your DA will not see that data.
Is there a particular reason you are doing this work through a DA and not through a process?

SANPAT

Dear AndyH
I am new to Oracle Apex and Learning , Can you please give me some tips , how to take such query from Process.
Its getting executed properly , but i don't know how to display the message once the Procedure Query will update the table . Can you please suggest.
Sanjay

1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 30 2011
Added on Jun 1 2011
2 comments
787 views