Ranganathan Kaliyur Mannar

+ Follow
since Oct 16, 2003
Ranganathan likes ...
Netbeans IDE Java Ubuntu
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ranganathan Kaliyur Mannar

The stuff in runnable, is it having some kind of while(true) loop with sleep?
That is the only case I see which can increase the number of threads...

Another question is why not make use of Spring provided @Async?
Hi Roja,
Welcome to the Ranch!

You need to show some code for us to try and help you. Please create a SSCCE and post the code and people can then run that code and try to help.
7 years ago
I am not well-versed with filters, but, simply calling the everytime on toggle click event should work.
7 years ago
There are several problems with the code, but to begin with, you have an incorrect understanding of CardLayout. I don't see any CardLayout methods being called - simply setting the panels visibility will not show them.
I suggest you go through Swing Tutorial for CardLayout to understand it and use.

Another suggestion would be to separate the Observer/Observable code from GUI and test it separately first before integrating with GUI.
8 years ago
Hi ofir,
Welcome to the Ranch!

I see some problems with your code:
a) Too long to read for people to help out - I suggest you create a SSCCE.
b) You are using both AWT and Swing components. ex.: TestField in the second class - this is a bad idea if intentional. If not, you should remember that Swing components start with a 'J' and you might have missed it.
c) I don't see any method where you set the text to (in the second class).
8 years ago
Welcome to the Ranch!

Normally, tree selection gives you the node object. Which has a method named getUserObject() which returns the object associated with the node.

Do checkout the tutorial which shows how to get the selected object.
9 years ago
Actually, lambdas will be needed if we are dealing with a POJO. However, with a JavaFX style JavaBean, PropertyValueFactory works (for editing too).
9 years ago
For similar situations, I have used the PropertyValueFactory with CellValueFactory, like:
new PropertyValueFactory<>("minValue");

and, Welcome to the Ranch!
9 years ago
What is the Java version targeted?

Oracle now promotes JavaFX for developing desktop applications - it is a good toolkit with CSS styling for UI. And has been integrated into Java SE fully since version 8. However, there will be a learning curve.

Another option is to look at platforms like NetBeans RCP if it is a large/rich application to be built.
9 years ago
All components have a setVisible() method. You can simply call setVisible(false) on the checkbox's action listener. Nevertheless, it would look odd when the checkbox disappears as soon as the user clicks on it.
9 years ago
Hi Ryan,
Welcome to the Ranch!

You can use the 'getText()' method to get the value in the text field. Your FXML does mention the 'fx:id' which is the variable name, but, I don't see it declared in the controller file.
9 years ago
PatienceIsAVirtue. You have to remember that people here volunteer their time for free to try and help. Expecting reply in few hours is unfair (and that too when you have actually got the first one within minutes).

The code has several problems. First of all, why do you add the ItemListener within a while loop? This doesn't make any sense and will have as many listeners. Instead, the loop should be within the item listener. Alternatively, you should think about using the contains() method of a collection. Secondly, you have to remember that ItemListener fires twice for a combo box (once for the old item and once for the new item). I don't think you need this in the current scenario. Would be better served by using ActionListener. Thirdly, your code doesn't look good with comparing with a String with spaces (ButtonConDiscon.getText()). You seem to be trying to see if the scenario is in a particular state. You should maintain the state separately in a variable (preferrably in a Enum) and use that.

Also, I would suggest you create a SSCCE and post the same for people here to run and reproduce the problem.
9 years ago
Hi Marc,
I tried a similar example in JavaFX 8 and I don't see the problem. If it is possible to upgrade to 8 and try, you should give it a shot.

Otherwise, would need a SSCCE to try and reproduce the problem.
9 years ago
PatienceIsAVirtue. People on this site volunteer their time for free to help you out. Expecting a reply within 40 minutes of the post is unfair.

Firstly, why do you use a MouseListener? You should be using an ActionListener. Secondly, decouple the problem from database calls. Create a SSCCE which shows this problem and it is also easier to help that way.
9 years ago
And, Welcome to the Ranch!
9 years ago