Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Sege Stephen

Ranch Hand
+ Follow
since Oct 06, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sege Stephen

I am still unable to solve this, all I want to do is to write the bytes in the outPutstream as a String. ie

run a Linux command, eg ls -l, and get the result / output stored in a String. Please help
9 years ago
Hello, I am trying to read a file on a remote server, which is on a Unix box. I don't mind if I can read it into a Stringbuilder or a file. The normal

which works well on windows would work for me.

So I am using SSH to connect, and then I am running commands
eg Cat /var/log/logfile.

I can view the content of the file on the console, but I cannot save it to a string or write to the file. I am having a nightmare with Converting the OutputStream to String or even FileOutputStream


here is a snippet



So my question is this, after running the command, I can see the command and the returned stuff in the console, but I am not having any luck writing the content into the file. I am able to write the first line into the file - out.write((command+";echo \'z4a2ce4f3317Z\'").getBytes()); this writes the command into the file, but the next lines which contains stuff returned is not copied to the file




9 years ago
@Rob, I am not passing the domain. Although I saw some examples on the internet where the domain are being passed.

I had solved this problem by mounting the drive. For anyone else wanting to know the solution, I mounted the drive by assigning it an unused drive. I used the process command -
net use F:/servername/shared \user username password
9 years ago
@Lester

Thanks the quick reponse. The remote machine is a windows 2003 server. With using the username and password, I get

"Logon failure: unknown user name or bad password"

What is the correct syntax for passing the password and username with the server & files details?
9 years ago
Hello, i have had a look at similar questions on here, but cannot find a solution

How do I read from a remote windows machine that requires password and username. Please note the C drive is shared. It requires login, I don't want to use ftp, just java io.

- is not working, it requires login

I am trying


But it is not working

I have also tried


But I get java.lang.IllegalArgumentException

URI has an authority component
please help
9 years ago
How do I get every row in a JTable that has a a tick in the check box column?

I need to read this into another text area. Here is a sample code I found on the internet that puts a check in a check box for each selected row

9 years ago
Following the response that I should make it an Array of object,

i changed my code to

Object[][] data;




The System out println is printing the desired result

[UK, 1, 1.13.64.2.91, 1, CACHE, false]was and is
[UK, 1, 1.13.64.92, 1, CACHE, false]was and is
[UK, 1, 1.13.64.93, 1, CACHE, false]was and is

but how do I set this into my array of object ? ie i need this in a table .
Please help, I am almost there

I want it to be like Object[][] data = {{"1", "2" , "3", "4" ,"5", "4"}, {"a", "b" , "c", "d" ,"e", "f"}};
9 years ago
Thanks for the feedback so far






This is not working
9 years ago
I have a List

List<List> myList has

[[UK, 1, 10.13.64.1, A, CACHE], [UK, 1, 10.13.64.2, B, CACHE], [UK, 1, 10.13.64.3, C, CACHE]]

stored in it, I need to put this data in a Table. so for the row and column it will be

A B C D E
1 UK, 1, 10.13.64.1, A, CACHE
2 UK, 1, 10.13.64.2, B, CACHE
3 UK, 1, 10.13.64.3, C, CACHE

How do i do this? I reckon I need to use a nexted for loop, but I am not getting the desired result.

how do I convert to it Object [][] data
9 years ago

Campbell Ritchie wrote:I can't see how either of those two lines can throw a null Exception.



Ritchie, line 04 throws an exception because there is no data in the MyTableModel. So that means I have to run load data first before creating an instance of MyTableModel, this then lead me to my problem, the table is not getting updated with the data.
9 years ago
One other thing

if I have a List of List;

like

[[UK, 1, 10.13.64.1, A, CACHE], [UK, 1, 10.13.64.2, B, CACHE], [UK, 1, 10.13.64.3, C, CACHE]]

how do I convert to it Object [][] data
9 years ago

Kevin Workman wrote:Where are you getting the NullPointerException?

I don't see how you're loading the information into your model. You should be able to create your JTable and the model at construction time, then populate the model with data whenever you load a file.



Hi Kelvin, I am getting Null Pointer exception if I try to create the JTable with an instance of MyTableModel before loading the file

so, if I do



it throws the null pointer. My intention is to create and load the table after the data has been loaded.
9 years ago
Hello Everyone,

I have a JTable inside my frame, I also have Field to get a file to be loaded. This data in the in the TableModel is coming from the excel sheet. I have a text field to find this excel sheet, when I browse and select the file, I click the load button to load this data. I am reading the data into my Table model and then setting the Column name and the Object [][] data in the MyTableModel class..

the thing is that if I hardcode the values for the Column name, and the data, when i create JTable with

JTable table = new JTable(new MyTableModel());

I get the table display with the data.

Problem is when I use the values I am getting from the excel sheet, I get the a null point exception because I haven't loaded the file.

so I figure out that my i need to create an instance of MyTableModel in the



however, the problem is that once the UI is already rendered, the table is not updating.

he is my myTableModel class



In summary, my question is how do I display my table after the loading file, and I also need it to get the table contents after I click load.
9 years ago
I would like to implement TabbedPane cycling for my Gui. If you look at firefox or IE 7, and you have many tabs opened, you can navigate using ctrl + tab, I would like this type of functionality in my Application. I have search online and cannot find anything, I can actually use short key by assigning a tab a number - ie Alt + 1 , for tab 1 ; Alt + 2 , for tab 2; Alt + 3 , for tab 3 and so on...... but that is not so cool. if you do control + tab, it is better that way..


Text books don't usually mention these things, if you have a reference code, it would be better.

Thanks
11 years ago