Thread View: aus.computers.java
1 messages
1 total messages
Started by Luk Van Kelst
Wed, 21 Jun 2000 00:00
Dringend probleem! GUI en repaint........
Author: Luk Van Kelst
Date: Wed, 21 Jun 2000 00:00
Date: Wed, 21 Jun 2000 00:00
52 lines
2408 bytes
2408 bytes
Hallo,
zou iemand mij kunnen helpen voor hetvolgende probleem (t'is voor mijn thesis):
Ik lees van ergens uit een file objecten en stuur die door naar de GUI:
//ergens in een klasse voor het inlezen. Er wordt 2sec gewacht.
while($play){
try{
ViewInfo in = (ViewInfo)rf.readObject();
System.out.println("##gelezen van file "+in);
//hier gebeurt het doorgeven van de informatie
for (int i=0; i<dest.size(); i++)
((InfoReceiver)dest.elementAt(i)).updateInfo(in);
synchronized(this){
try{
wait(2000L);
}
catch(InterruptedException e){}
catch (IllegalMonitorStateException em){
System.out.println("foutje timer Monitor");
}
catch (IllegalArgumentException ex){
System.out.println("foutje timer Argument");
}
}
}
}
In mijn GUI staat een methode:
public void updateInfo(ViewInfo inf){
UdpHeaderParserInfo info = (UdpHeaderParserInfo)inf;
_sourcePort.setText("Source Address : "+info.getSourceAddress());
_destPort.setText("Dest Address : "+info.getDestAddress());
_data.setText(info.getData());
repaint();
}
private JTextField _sourcePort;
private JTextField _destPort;
private JTextField _data;
Het probleem is dat hij eerst de file volledig leest en dan pas de repaint()'s doet. Hoe forceer ik dat hij na elke oproep van updateInfo(ViewInfo inf) een repaint doet.
Hartelijk dank
Luk
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads