Win a copy of Rust Web Development this week in the Other Languages forum!

Nalaka Gamagelk

Greenhorn
+ Follow
since Jun 11, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nalaka Gamagelk

Mohamed Sanaulla wrote:

nalaka info wrote:

I have created my own nested class action listener by implementing ActionListner class. Now I want some of the buttons in the GUI to be listened by my listener. How can I do that? Properties -> Events do not see my coded listener. There fore I want to by code add my action listener to buttons.



You need not set the Action listener from the UI. What you can do is- after the call to initComponents() [dont know the exact name of the method for initializing components] you can add a line there- button.setActionListener()



Thanks a lot !
calling button.AddActionListener() after call to initComponents() in constructor worked.

Mohamed Sanaulla wrote:I dont know if that is possible right from the Netbeans IDE. But one way which I had followed was to open the source file in a normal editor and then make the changes there.

But for most of the changes- the UI provides an option. What kind of changes/tweaks are you planning to do?



I have created my own nested class action listener by implementing ActionListner class. Now I want some of the buttons in the GUI to be listened by my listener. How can I do that? Properties -> Events do not see my coded listener. There fore I want to by code add my action listener to buttons.
I have been hand coding Swing GUI applications. Now I want to move to NetBeans to create my SWING applications. What are the best practices? Especially I am struck because most of codes are uneditable. Is there a way to make them editable (At least a tweak) other than using design views?

Thanks
Nalaka
In My application I have one to many relationshp between Author and Book classes.
Author 1---->* Book. I have done the mappping as follows;

Book.java


Author.java



I am using merge operation for updating detached objects. When ever I am updating or adding Book objects and Merging the Author object, changes are reflected in the database. However when I client have remove Book object (Say in the database there are three books related to Author, But now I am caling merge operation with two Books objects with matching pk in the collection.

But I do not see missing Book object being deleted from the Book table. Can someone help me explaining how to do this. Is there any way to remove books (many side) without explicitly deleting those. i.e. By Merging Author object.

Thanks.