Advertisement

[java] SWING

Started by January 16, 2001 12:37 PM
4 comments, last by rockslave 24 years ago
How can I make a mutable Jlist? I try to do it and it crashes! I''m using JDK1.2 under WinNT import money.*; #include "cas.h" uses bucks;
import money.*;#include "cas.h"uses bucks;
What kind of a fool uses NT?
Advertisement
What kind of fool wastes time to say such an unuseful answer?

import money.*;
#include "cas.h"
uses bucks;
import money.*;#include "cas.h"uses bucks;
What do you mean by mutable? I assume you have tried setListData. What errors do you get?

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
JList myMutablelist = new JList(new DefaultListModel());

The items within the JLists model can now be changed by the following calls:

String item = "Item";
DefaultListModel dlm = (DefaultListModel)myMutablelist.getModel();
dlm.addElement(item);
dlm.removeElement(item);

Found this surfing. I want my %5.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
Thanx guys, I got it already! And it can also be done with vectors and obejct[]s.

import money.*;
#include "cas.h"
uses bucks;
import money.*;#include "cas.h"uses bucks;

This topic is closed to new replies.

Advertisement