David Hittel

Greenhorn
+ Follow
since May 25, 2007
Merit badge: grant badges
For More
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 David Hittel

Hi,

i have following Problem. I have a couple of jTextField's that are registered to a DocumentListener.

I had the problem that i got always the Exception

Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Attempt to mutate in notification
at javax.swing.text.AbstractDocument.writeLock(AbstractDocument.java:1343)
at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:662)
at javax.swing.text.JTextComponent.setText(JTextComponent.java:1441)



Then i was reading a little bit and found a solution, but this solution causes another problem, a endless loop and i get this



I want to call a method "calculate" with just some normal calculation from jTextField values.


The DocumentListener


calls the berechne()



Do you have any solutions, to solve the problem.
16 years ago
Oh no, forget my posting before.

The Vector is still working correctly, but the copied class is still referring on the mother class.

Any suggestions?
16 years ago
Yeah, your right that was totally stupid.

I assigned now the Content of the Vector to the new one and its working ;-)

for(i = 0;i<einKalkulation.getSize();i++) {
einKalk.link((Rohstoff)einKalkulation.Rohstoffe.get(i));
}

Thank you Ulf
16 years ago
Hi,

i have following problem, i try to copy a object from following class:



i need to implement a deep copy method, because i have an vector in that class.

i tried it with this method



What this method is doing right now, is to create a new object but reference from the variables is still on the old object. The Vector is working fine and is referencing on a new created Vector.

What do i have to change???

Thanks

David
16 years ago
How can i do that?

i have no idea how i could write this code. I would write in my gui class where the combo box is following method

public String toString(){
....
return name;
}

But what do i write in between and when do i call the method?

Thanks

David
16 years ago
Hi,

i have following Problem, I add some Objects to a ComboBox. In the GUI i see now the objectsname and the ID. Is it possible to display instead a Attribute value of this object per Example the attribute name. You cant really identify the object over the ID.

Now its "Class@73dds676d7" and i want to show a name like "Apple juice"

Do you have any Suggestions?


Thanks

David
16 years ago
Hi,

i have a question. I want to change get a Listener thats reacts, when i change the Numbers/Text from the jTextField and when i select a diffrent thing in the ComboBox.

What is the right right Listener for that?

Thanks

David
16 years ago
Hey

Some solutions are so easy that i dont tought about it.

Thanks a lot for your help

David
16 years ago
Hi,

i have following Problem. On one Panel i have eight JComboBox's named JComboBox(1-8).

Now i have following Method to fill the ComboBox model

public void updateJComboBox() {

DefaultComboBoxModel model = (DefaultComboBoxModel)jComboBox1.getModel();
Rohstoff Ro =null;

Object[] tabelle = all_Rohstoff.getAll();

for(int i=0;i< tabelle.length;i++) {
Ro = (Rohstoff)tabelle[i];
model.addElement(Ro.getName());

}
}

This is working fine, but i don't want to repeat the method 8 times. Is it possbile to fill all 8 Boxes trough one method call.

This line has to be different

DefaultComboBoxModel model = (DefaultComboBoxModel)jComboBox1.getModel();


Thanks alot

David
16 years ago
Hi i solved it myself, typical i tried to solve it for hours then you post you problem and then you find the solution. :-)

Here the code

RohstoffListe RoLi = new RohstoffListe(desktopPane);
desktopPane.add(RoLi);
RoLi.setVisible(true);
RoLi.hasFocus();

Its very important that you call setVisible after you added it to the DesktopPane otherwise the Window will get no Focus.

Bye
16 years ago
Hi everybody,

i have a weird Problem with my application. I Have a JFrame with a DesktopPane and to this Pane i add JinternalFrames like this

BetriebListView BeLi = new BetriebListView();
BeLi.setVisible(true);
desktopPane.add(BeLi);

But the problem is when one JinternalFrame is open and i open another JInternalFrame, the first JIF is always on top and the other JIF is hidden behind the first.

Somebody of you has any suggestions?

Thanks alot

David
16 years ago