This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.

Branko Paskutini

Greenhorn
+ Follow
since Apr 18, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Branko Paskutini

Hi all!
Mac OS X 10.2.6, Sun Java 1.3.1_03. Swing based application developed under Win2000 and Java 1.3.1, now testing it under OS X. Seem to have a major issue with objects which are extending JDialog. Worst of all, the behaviour is inconsistent, so I cannot pinpoint what is causing these problems, and have to start sentences with "sometimes, certain windows..."
1. Sometimes, certain windows are not properly displayed on the screen: JButton's, JLabel are not there at all, the window itself is almost white in colour (normally it's grey). The "workaround" is to resize the window, after that all the components are properly displayed. Here is the standard code used (loginPanel is JPanel consisting of three other panels with JButtons, JPasswordField, JLabel, etc components. "this" class extends JDialog):

2. Sometimes, certain windows are displayed in the centre of the screen, and sometimes in the top left corner. And I mean the same windows, invoked the same way. I'd like them to be centred. I tried both

and

They don't seem to make any difference.
If someone could suggest what can I do to fix these problems, or point me to the web site where Java development (or should I say deployment) is discussed in detail, that would be great.
Thanks, Branko.
21 years ago
That was it!
Thank you very much Chella
Branko.
21 years ago
Hi, would someone be able to tell me how to change JFileChooser's title bar icon? Something similar to java.awt.Frame's setIconImage(). I also had a look at all the options for UIManager.put for FileChooser and couldn't find anything.
It seems all the other components have UI value and can therefore be modified, except title bar icon? At least I cannot see it when I run this code:

For example, I've noticed there is an UI entry for the open dialog title bar text (FileChooser.openDialogTitleText), and that one can also be modified with the JFileChooser's setDialogTitle(String) method. So I am trying to find out a way to do the same with the title bar icon. Programmatically, or by setting UI value, I don't care.
I am using JDK 1.3.1 SE.
TIA, Branko.
21 years ago
Hi all, I am using JDOM and Xerces to parse the external XML file, and everything is working fine. Now I'm trying to include DTD for validation, and have few questions:
1. Do I have to manually edit XML file to specify which DTD file to use?
2. Do I have to specify all XML elements and their children in DTD file? I am only interested in a few, the others may or may not be there.
3. Any thoughts on XML Schema vs DTD?
Thanks and regards, Branko
Hi Liang, you can use PreparedStatement's method. PreparedStatement is superinterface to CallableStatement.
Branko.
Thank you Janet and Anand.
I didn't mean to scare anyone with my 'best practices' statement, I just thought that would better explain what I am after. Come to think of it, ANY practices would do.
I will be closing all the resources in the 'finally' block, but the difficult part for me is what to do within the 'catch', apart from logging it (will most likely use Log4J). I read about the exception chaining, seems like a good start.
http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions-p2.html
Hello, does anyone know good web resources (articles, web pages, whatever) where the "proper" Exception handling is explained, specifically when coding against database? Something like "best practices" in Exception handling.
I am writing server component of the application which is manipulating the db. Requests for db manipulation will come from the clients via Servlets, and my component will be sending them Responses.
I was only able to find introductions or EJB specific articles. What I am after is a real-life Exception handling policies for JDK and JDBC.
Regards, branko.
Thank you both! Looks like creating new PS each time is the go.
Regards, Branko.
Hi all,
I would like to set column name in my prepared statement with parameter. For example, user might search by column FirstName (SELECT * FROM TableName WHERE FirstName = 'Homer'), or by column LastName (SELECT * FROM TableName WHERE LastName = 'Simpson'). To do that, the PreparedStatement should be "SELECT * FROM TableName WHERE ? = ?". If I try to set the column name on that PreparedStatement with the setString method, JDBC driver doesn't like it, because the 'setString' method puts either single or double quotes around the column name. Could someone please suggest how can I set the column name with parameter without having it enclosed in quotes?
Thanks, Branko
Hi Pallav, thank you for your reply. My listener is just like yours, except I don't have "e.getClickCount() > 1". The annoying thing is that it is working 90%-95% of the time, so it's not easy to detect it. The best way to test this is to add println statement to the mouseClicked(), then get all 24 records in JTable, and start clicking.
Since I didn't hear back from anyone I started suspecting it might be something in my code if no one else has experienced it. But it's such a simple piece of code, and why is it working 90% of the time??
OK, I think I found it! After adding mousePressed() and mouseReleased(), I was able to reproduce it - after some clicking, it did NOT respond to mouseClicked(), but it DID to mousePressed() and mouseReleased()! I'll do some more testing, but so far these two new methods are responding 100% of the time.
BTW, I am using JDK 1.3.1 under Windows 2000 Professional.
Thanks, Branko
[ May 19, 2002: Message edited by: Branko Paskutini ]
Hi all,
I have added MouseListener and KeyListerner to JTable, used their Adapter classes and implemented keyReleased() and mouseClicked() methods. I have noticed, quite by accident, that the listeners do not always respond to these events. I would say 9 times out of 10 it is working fine and I am getting the correct record, but the 10th time I have a problem. One record is selected (clicked on and it's colour changes to purple), but the application thinks the previous record is selected, and makes booking on that record? This is pretty major. I did some more testing, and sure enough, it might be 1 in 10, it might be 1 in 20, but it happens. JTable responds by changing the colour, but the listeners don't pick it up.
Has anyone else noticed this?? Please let me know.
Thanks, Branko.
Sorry, my mistake. When I use single forward slash instead of double, I don't need drive letter. All is good.
As for my second comment (VMS, MVS, Mac), should we pretend they don't exist?
Thanks, Branko.
Hi Mark, thank you for your reply. If I go with the absolute path and I don't use drive letter and start the path with /, shouldn't it start from the root? Doesn't look like it (under NT). And I don't have access to the Unix box, so I can only hope this would work under Unix. I was hoping I would not have to use relative path, I don't really want to force them to install db.db and policy files in the subdirectories below where the jar file will be. But, at least it will work under NT and Unix.
I was talking to the VMS guy who said the command I am trying to use would not work under VMS. Dash has to be replaced by forward slash and the path has the format of <dir.dir>. The command required would look like:

I can imagine on MVS the format would be different again. So there is no way I can give them the command line which will work regardless of the OS. Ah, the wonders of interoperability
Thanks, Branko
Hi all,
I have a question about the following requirement from the instructions (let me try this quote thingy):


Specifically, you should document clear, simple command lines that allow your programs to be run on any Java 2 platform, regardless of the underlying hardware and operating system


Too easy . Now, if I send a file as an argument to the program, under Windows I found that I have to specify the drive letter (ie, //client//db//db.db does not work, while E://client//db//db.db does work). Even though I am running the java command from the E: drive.
I don't know much about Unix, but I know that it doesn't have drive letters like Windows does. And I assume that the first example would be the correct argument under Unix. So how can I give them the command line which will work "regardless of the underlying operating system"?
Thanks, Branko.