Rok Štelcer

Ranch Hand
+ Follow
since Nov 03, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rok Štelcer

Remove repaint(), as Michael already said ...
15 years ago
Just a hint .... split method accepts a regex.
15 years ago
AbstractTreeModel doesn't exists ...
edit: Google
--> AbstractTreeModel
15 years ago
Regarding the second link ... I guess it's the answer to:

Lila Fowler wrote:Some errors that appear in the console don't necessarily appear in the log


When redirecting the console output to a file, you have to use "2>&1".
Otherwise, you'll only see standard output ...

Lili Fowler wrote:But the console is a default function in java, what part is actually accessing the original console data?Would

1. orgStream = System.out;

then contain the original data?


Well, printing to console output is indeed the default operation of stdin, stdout & stderr.
However with System.setXXX(...), you have the possibility to redirect it to e.g. a file.
So in above case it only contains the ref to the System.out, which is later used to restore the printing back to the console.


Regards,
Rok
15 years ago
Hm ... in that case I guess you only need to write err stream, right?
Try the following example: redirect.

Does this help?
If not, what about this one?

Perhaps I just don't understand what you're trying to do. ;)
15 years ago
If I'm not mistaking, a max size of a String is Integer.MAX_VALUE (2GB) ... 2 bytes per Unicode char --> 4GB.
In case of a 32bit arch, you should get out of memory first ...

So, I guess the problem is else where.
15 years ago
I guess you didn't ask uncle Google yet. ;)

Hope you'll find something useful.


Regards,
Rok
15 years ago
Hi,

Perhaps you'll find an answer here.
Although it is a how to for JBoss, there are also some general tips.

Hope it helps.


Regards,
Rok
15 years ago
Hi,

You could add items into the list and then call Collections.sort(list) (or Arrays.sort() in case you prefer to work with arrays).
Afterwards you would (re)add the sorted items into the combo box.

Another more general solution would be to create your own sort model ... meaning that item would be sorted immediately after insertion.


Regards,
Rok
15 years ago
Hi,

Kevin Tysen wrote:When I typed something in the JTextField, the program tried to change the text too


Perhaps you should just show the suggestions and not immediately change the input.

Anyhow, the best would be to share your code (a snip) with us ...


Regards,
Rok
15 years ago
Here you go:


Regards,
Rok
15 years ago
Hi,

Ravi Kiran V wrote:I have written a Template for getting Oracle Connection for my Application


What do you mean a template ... like a template pattern?
If so, this is not a template pattern (see: Template) ... would have to say more of a singleton.

Anyhow, regarding the code.
Perhaps your getConnection() method should return only a connection, without any init or lookup stuff in it?
Meaning you could create a:
- lazy loading singleton (created on demand ... first use)
- or put the init in a static initializer (created when class is loaded ... if not too early)
- or make a inner wrapper for the initialization and again use a singleton

Beside this, you'll have to catch following two execptions: SQLException & NamingException.
edit: or since this is a static method, you should perhaps re-thrown some custom exception with appropriate msg.

Hope this helps.


Regards,
Rok
15 years ago