Results 1 to 2 of 2
Thread: can any one plz find the error.
- 03-23-2011, 09:18 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 1
- Rep Power
- 0
can any one plz find the error.
Items are not added in ComboBox is the main problem.
here actually i'm adding items in combobox where the items are the output of the execution of script. i don't know y the items are not added in the combobox can u plz find out the problem....
and here is the code.
String line;
JComboBox combo=new JComboBox();
ProcessBuilder pb=new ProcessBuilder("./script.sh);
Process p=pb.start();
BufferedReader output=new BufferedReader(new InputStreamReader(p.getInputStream()));
while((line=output.readLine())!=null){
synchronized(this){
combo.addItem(line);
}
}
- 03-23-2011, 09:34 AM #2
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
Java Code:String line; JComboBox combo=new JComboBox(); ProcessBuilder pb=new ProcessBuilder("./script.sh); Process p=pb.start(); BufferedReader output=new BufferedReader(new InputStreamReader(p.getInputStream())); while((line=output.readLine())!=null){ synchronized(this){ //does the line gets printed on the console? System.out.println(line); combo.addItem(line); } }Swastik
Similar Threads
-
cant find the error , please help.
By TheBreadCat in forum New To JavaReplies: 13Last Post: 02-12-2011, 07:17 PM -
Exception error and I can't find the cause
By Lish in forum New To JavaReplies: 2Last Post: 01-31-2011, 09:53 AM -
Find the error in this and why this can't be ?
By ron2794 in forum New To JavaReplies: 11Last Post: 12-14-2010, 03:23 PM -
Can't find error in my program!
By kkGG in forum New To JavaReplies: 2Last Post: 11-10-2010, 05:38 PM -
I need help with an error! Cannot find symbol error!
By ambria1975 in forum New To JavaReplies: 2Last Post: 07-07-2010, 01:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks