/    Sign up×
Community /Pin to ProfileBookmark

GUI Reflect Changes

Hi,

I have a set of Lists to be managed using JList manager which contains a next button that display a next List. Althogh the next list will appeared, the other components of the JFrame doesn’t affect by this change for example the previous button still embedded and so on.

I tested the other parts by creating a new frame every time the next button is clicked and every thing goes OK.

Thanks,
Hind

to post a comment
Java

2 Comments(s)

Copy linkTweet thisAlerts:
@CytaelMay 29.2006 — sounds like you just need to explicitly remove the stuff you don't want shown...aside from that, posting some code snippets would help...
Copy linkTweet thisAlerts:
@HindauthorMay 29.2006 — How can I show the reflect to all other components.

Code:
[CODE]public void ListChooser( Object[] original, Object[] chosen )
{
this.original = original;
this.chosen = chosen;

if(freq == 0)
getJFrame();
else{
getOriginalList();
// SwingUtilities.updateComponentTreeUI(jFrame);
}
}

private JList getOriginalList() {
if (originalList == null) {
jFrame.setContentPane(getJContentPane());
originalList = new JList();
originalList.setAutoscrolls(true);
}
originalModel = new DefaultListModel();
for( int i = 0; i < original.length ; i++ ){
originalModel.addElement( original[ i ]);
}

// SwingUtilities.updateComponentTreeUI(jFrame);

clusterList.updateUI();

//getJContentPane().revalidate();
getJFrame().setVisible(true);

return clusterList;
}

private JButton getNextButton() {
if (nextButton == null) {
nextButton = new JButton();
nextButton.setText("Next");
final ClusteringDemo cd = new ClusteringDemo();
nextButton.setEnabled(freq < ClusteringDemo.getClustersSize()-1);
if(nextButton.isEnabled()){
nextButton.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent e) {
if(originalModel.getSize()!= 0){
cd.manageClusters(++freq);
clusterLabel.setText(
"Cluster ["+ (freq+1) + " / "+ ClusteringDemo.getClustersSize() +"]" );
}

else
cd.manageClusters(++freq);

}

});
}
}
return nextButton;
}

//At other class
public void manageClusters(int freq){
....
choose.ListChooser(members, nodes);

}
[/CODE]
×

Success!

Help @Hind spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...