Win a copy of Head First Android this week in the Android forum!

Naf Rash

Ranch Hand
+ Follow
since Feb 19, 2004
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 Naf Rash

Hi, This might be a stupid question- but I don't really know the answer to it so please help. I have been able to produce a program that connects to a database, does some processing to the data in there and then outputs the results from this program. It appears to work as it should. When I have a databse of 50 records the program promptly returns some results but any table with over 50 records causes some sort of problem; some processing is done but then it stops ie, the program appears to be still running but nothing is output - it seeems as though it gets stuck somewhere (I can see this happening because the pribnt stmt to verify processing is going on stop). Any ideas why???
17 years ago
I wanted to ask - how do you get rid of a frame/contentPane completely without causing a program to terminate? I have used setVisible(false) but just empties the content pane- i just want to discard it.
17 years ago
Well at the moment when a file is saved using this dialog, I can't open it but if I had used this:
"P:\\filename.txt"
then the file is saved and opened through notepad(which I do not specify)
17 years ago
I am using a Save JFileChooser but want all files to be saved as textfiles. How do I do this? Could you please provide some examples.
17 years ago
I just want it to display/store the sets of numbers that I produce.
So are you saying that creating an instance of the class - like you normally would will work? ie,
public class classA{
public void Button(){
......
if (Button pressed){
classA a = new classA();
}
else......

}
}
I know that this would not work in a program - I am just doing it for illustrative purposes.
17 years ago
Just a quick question. I have some data in the form {some numbers separated by commas} which are saved to a text file. I can do this and it is working but what I wanted to know is whether it is possible to save the {numbers} into a database so that each field contains a {...}. If so how can I do this and do you have any egs. Any help will be greatly appreciated. Thanks.
Suppose I have three classes- Class 1, class 2 and class 3. Class 1 is the main class. Class 1 creates an object of class 2. Class 2 creates an object of class 3. Class 3 wishes to have a fileChooser dialog box disaplyed which requires the parent component to be called (ie, the frame in which the dialogue should appear.). However, this component is in class 1. How do I tell it to use the frame and set sizes from the main class (Class 1)?
Please Please try to help - I'm really stuck!!
17 years ago
Is it possible for an instance of class to be created within itself? For example, if ClassA is running and a certain button is pressed (defined in classA) then a new instance/object of classA is created - so that for this case the original object is running as well as the new one. (2 programs of the same class running?)
17 years ago
I am trying to write some results from my program to a file - I think this should be fairly straightforward especially since there is quite a lot of information to do that. My problem is with respect to the way I need the results to be written to the file. For instance, the results I want displaying are in an array - and for each line of the file I want all the rows for a particular column to be output in the following way:
{some numbers(ints) separated by a comma indicating the next element for that column(ie, the next row)}
I want this to be done for every column.
My problem is that I don't know how to do this - if it was a matter of taking some data from a textfield the matter would be fairly straight forward.
Does anyone have any suggestions???
17 years ago
I am using a database in my program and I want to be able to create a radio button which is named after a column name- obviously I can't specify the name of the column myself because the number of column may change for each database as well as the names for them. I have tried the following but get an error indicating that the left hand side must be a variable name. How should I do it?
for(int i=0; i<rsmd.getColumnCount(); i++){JRadioButton (rsmd.getColumnName(i))= new JRadioButton("" +rsmd.getColumnName(i)+ "");}
17 years ago
If I use System.arraycopy do I need to insert the first element into the new array first and then invoke this method? Please could you explain.
17 years ago
just a simple question. I have an array but now want to add something to the first element of it without deleting the first element that already exists there (ie, the original first element moves up to the next element...). The only way I can think of doing this is to move all the elements up one place and then add the new element - but this doesn't seem to be a very good idea.
Alternatively, I could use vectors instead to maintain these elements but when I add the new element will I have to do the same as I would for the array or would placing the new element in the first position of the vector automatically move everything else up one place?
Please help. I need some advice.
17 years ago
Thanks for your help - but I made a really stupid mistake - my try block was throwing an exception and it was being caught. Within my try block there was a println statement which showed whether the value ok k in the inner loop was being updated but this was not being reflected since the exception was being thrown before reaching that statement. Sorry. Thanks for all your help though - I really do make the silliest of mistakes!!!
17 years ago
I have a catch block after the try block which catches ClassCastException. I can't think of any other exceptions that may be thrown. Any other ideas?
[ March 16, 2004: Message edited by: Naf Rash ]
17 years ago