Fon Drank

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

Recent posts by Fon Drank

What's the simplest process for doing an 'application update' check (without webstart)? Would this work:

1) set up a file on a web server that has the latest version information
2) in the application, have a 'check for updates' option that pings the web
server and retrieves the version information and checks it against the version of the app currently runing.
3) if they match, tell the user he has the latest version, else open the browser to a web page where they can install the latest version.
17 years ago
Is it possible to open and use a java applet from a desktop swing application?
17 years ago
For the frame, use


For adding components, use
17 years ago
hi,

I have a button that calls a pop up frame.

when using frame.setLocationRelativeTo(button), it centers my frame around the button. But I want the location of the frame to be right underneath the button. Is there an easy way to accomplish this?
17 years ago
Is there a way to associate a file type with my app so that whenever the user clicks on the file, it automatically opens up my java app and uses that file name as the first command line parameter? Sort of like how if a user clicks a .xml file, it will automatically open in XML Spy or whatever.
17 years ago
Is there a standard buffer size one should use for reading and writing out bytes of data? What's considered a "small" buffer size, a "normal" buffer size and a "large" buffer size? If most files you transfer are going to be between a few kB and up to 10-20MB, what is the optimum buffer size to use?
17 years ago
The form is very complicated and long, over ten pages, lines everywhere, multiple columns, images, nothing standardized, it's a real mess. It would be a huge hassle to do it with Swing. Furthermore, I don't think I could fit everything on screen without making the font pretty small, so they'll probably complain about wanting to be able to zoom in and out. I don't think it's an easy task to get swing components to 'zoom' like this, especially when there are literally hundreds on a page. Or am I mistaken?
17 years ago
I don't like it, there's not enough flexibility. Maybe things have changed since I last took a look at it.
17 years ago
I have a client that is very hung up on creating an electronic version of a government form that looks EXACTLY like the actual paper form. She will not except that all the fields are the same, no, it has to look EXACTLY like what the paper or PDF looks like, down to the last detail. This means I can't use the standard set of Swing tools to do the layout.

I can't just use Adobe Acrobat and do a interactive PDF form, though, because there's alot of functionality I need to incorporate into the form that I can only do with a full-fledged language like Java.

So my question is, what's the best way to handle this? Should I save an image of the form and then incorporate it into a JPanel, and somehow make fixed text fields and check boxes over the actual ones on the form? Is this doable? Or is there some other way to do this?
17 years ago
Is it possible to create a zip file and use it like a regular directory structure? I would like to be able to store all my files directly to the zip file and read my files directly from it as well.

Or is there some alternative? Basically I need to have a bunch of files together in one central location. But I can't put them all in a regular directory. I need them to be all in one file.
17 years ago
Is there a standard way of saving "attachment files" in xml? I have looked and it seems like most people recommend base64 encoding binary data.

So can someone critique my workflow thoughts for attaching files and retrieving them later on from xml?

attach files workflow:
1) user selects the file to attach
2) store the file in memory as a byte stream
3) use some kind of API to base64 encode the byte stream into a String
4) write out the string to xml

retrive file and display workflow:
1) retrieve the String from xml
2) convert to a byte stream using base64 decoding API
3) write out the byte stream to a temp file
4) call high level API to open the file using whatever program the OS associates with the file extension

Any help is appreciated! Also, is there a standardized tagging convention for storing attachments in xml?
This was a good idea, but I doubt it will work. I just tried it with the JDNC library, which is basically the same as java.awt.Desktop, and I got a error back "The given file is a directory".


Originally posted by Jim Yingst:
Your code for the Mac seems to be right for OS X - aside from missing a space after the /usr/bin/open. I don't know if it would work for older systems, but that's probably not a small number of users anyway.

Another option is if you're using JDK 6, you can use java.awt.Desktop to open() the directory with simple platform-independent code. That's nice, but only works if you can reasonably expect your users to have JRE 6 installed. For some applications that may be a perfectly reasonable expectation, but for others, not.

17 years ago
I would like to add an action to my java application that takes a user to a specific directory when they click on the toolbar icon. For users using Windows, this is easy since I can just call explorer.exe from the command line. However, I don't know the equivalent in Mac OS or Linux. Can anyone help with this? I think in mac, I can use /usr/bin/open?

if (System.getProperty("os.name").beginsWith("Windows"))
{
Runtime.getRuntime().exec("explorer.exe " + path);
} else if (System.getProperty("os.name").indexOf("Linux")!=-1)
{
// What goes here?
} else if (System.getProperty("os.name").beginsWith("Mac"))
Runtime.getRuntime().exec("usr/bin/open" + path); // is this right?
...
17 years ago