|
The problem is that when I do attach the CellEditor to my table when I remove a row WHILE a cell is being edited the rest of the row gets deleted, leaving behind a rogue cell!
Then decide - Editing OR deleting. Can't have both. Is the system deleting the row or how is it done?
|
|
|
|
|
ecrir un programme compose une formule en sous formule
|
|
|
|
|
1. This is an English language site.
2. We do not write code to order.
3. Even translated your question makes little sense.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
djamelm61 wrote: ecrir un programme compose une formule en sous formule
as I guess you are using French Language. Please try to use English Language to write any thing
|
|
|
|
|
|
Please try to use English Language to write any thing.
|
|
|
|
|
I Could not understand the question. Please write it in English.
Aniket.
|
|
|
|
|
I gave same suggestion to OP. everything should be written in English that can understand by everyone
|
|
|
|
|
I recommend that you take your own advice. A few more classes in English will do you some good.
|
|
|
|
|
As if you all are not able to speak other languages
He wants to create some area or document inside another area/document. Not sure about what he's really up to.
But as he is not able to write a complete explanation, he probably does not want a complete answer.
|
|
|
|
|
More or less what I said in the first reply. I don't know why all the others had to repeat it; probably just trying to harvest rep points.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
oh, yeah, must be the reason.
oh look, 10 points again
|
|
|
|
|
hi! This is my class Roster.
public class Roster
{
int[] shift;
int length;
public Roster()
{
length=30;
shift=new int[length];
}
public Roster(int[] s)
{
shift=s;
}
public int[] getShift()
{
return shift;
}
public int getLength()
{
return shift.length;
}
public String display()
{
String out="";
for(int i=0;i<length;i++)
{
out+= shift[i] + " ";
}
return out;
}
}
i'm not sure this coding above is correct or not. Output can't display in text file.hope u all can help me fix this problem
This is main class
public class NurseMain
{ public static void main(String[] arg) throws IOException
{
try
{
FileReader reader = new FileReader("Roster.txt");
BufferedReader in = new BufferedReader(reader);
FileWriter writer1 = new FileWriter("Output.txt");
BufferedWriter bw1 = new BufferedWriter(writer1);
PrintWriter out1 = new PrintWriter(bw1);
FileWriter writer2 = new FileWriter("initialAffinity.txt");
BufferedWriter bw2 = new BufferedWriter(writer2);
PrintWriter out2 = new PrintWriter(bw2);
FileWriter writer3 = new FileWriter("initialClash.txt");
BufferedWriter bw3 = new BufferedWriter(writer3);
PrintWriter out3 = new PrintWriter(bw3);
String input=null;
ArrayList RosterList = new ArrayList();
int length=30;
Roster R = new Roster();
int[] shift=new int[length];
while ((input = in.readLine()) != null)
{
StringTokenizer st = new StringTokenizer(input,",");
for(int i=0;i<shift.length;i++)
{
shift[i]= Integer.parseInt(st.nextToken());
R=new Roster(shift);
}
RosterList.add(R);
}//end while
for(int j=0;j<RosterList.size();j++)
{
R=(Roster)RosterList.get(j);
out1.println(R.display());
}
|
|
|
|
|
the main(args[...]) is incomplete. What's your question?
The class Roster looks quite OK. I would prefer a toString() instead of the display() - that's a more common way. But that's just makeup.
regards Torsten
I never finish anyth...
|
|
|
|
|
i want to count how many shift that equal to 3 in first arraylist.. i don't know how to call it.. thanks
R=(Roster)RosterList.get(0);
{
for(int i=0;i<shift.length;i++)
{
if(R.getShift(i)==3);
{
cnt++;
}
}
System.out.println(cnt);
}
|
|
|
|
|
a bit confusing.
You have a list of roster and a roster has like 30 int values in a array.
while ((input = in.readLine()) != null) {
StringTokenizer st = new StringTokenizer(input,",");
for(int i=0;i<shift.length;i++) {
shift[i]= Integer.parseInt(st.nextToken());
R=new Roster(shift);
}
RosterList.add(R);
}
Is that correct?
You are going through that file "roster.txt". One text line presents a Roster object.
You're reading one integer and renew the Roster object "R" each time (bad - init the Roster object afterwards!).
After that you're adding the filled Roster object to a list "RosterList".
Questions:
- What happens if there are more int values in the line than the initial size of shift (fixed to 30 values)??
- What happens if one value is not valid?
- What to do with FileWriter "out2" and "out3"?
regards Torsten
I never finish anyth...
|
|
|
|
|
yes i need to read from a text file (Roster.txt). In object Roster, i have 30 shift..
and this is example of my text file
1,3,4,2,4,1,4,4,4,4,1,3,1,1,4,2,1,2,1,2,3,2,1,3,3,1,1,2,4,2
the file writer out2 and out3, i used to print another output but i'm not finished yet
|
|
|
|
|
ok, then go ahead. looks quite good so far.
You might create a Parser object to do the dirty job for you - I don't know if this fits your class or your teacher is pleased with that, but that's also a common thing to do. Keep the main as clean as possible.
regards Torsten
I never finish anyth...
|
|
|
|
|
thank you.
we used code & it worked so goooood.
http:
http:
|
|
|
|
|
Always wrap your code in pre tag.
|
|
|
|
|
How can I disable my Window 7 Desktop in Java while showing some warning? I am making a Timer program in java and need to disable the desktop if the time is over and enable again if the admin allows it.
I just want to know the keyword of disabling and enabling the desktop. Just like this
To shutdown a PC = shutdown -s
Any help is appreciated.
|
|
|
|
|
I am curious to know why are you trying to Disable your Window Desktop. whatever you can go there[^] to get something to learn how to Disable or Enable desktop using java.awt.Desktop API
|
|
|
|
|
The purpose is the user will not allowed to do anything on desktop. Only the user allowed to access the desktop if the timer start again. Any other idea?
|
|
|
|
|
maybe you should use API of windows; I have another way to realize this, you can use java.awt.Robot to control your machine.
|
|
|
|