Dave Mace

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

Recent posts by Dave Mace

The poi library from http://jakarta.apache.org/poi/ has the functions you are looking for.

Hope this helps.
19 years ago
I did this for an application I wrote that required immediate notification in the event of specific events. Well, I say "immediate", but in reality there is some delay of course with the cellular system, etc... But I digress, check out the following link:

www.clickatell.com

That company is a provider of SMS messaging meaning that they will provide an api that you integrate into your application to generate SMS messages from their hardware and you are charged a rate on each message. I chose not to use their api, but rather use the email feature which lets a user send an email with the sms details and their system auto-formats this into an sms and then it is sent.

Hope that helps.
David
19 years ago
POI can be handy for writing Excel documents. It has some functionality with Word .doc files as well if you're interested, but that part of the api is not quite up-to-snuff yet. Their priority seems to reside with Excel which is where most of the interest probably is anyways.

David
19 years ago
Howdy,

I know I'm a little late here, but just wanted to offer some advice in case you plan on sticking around. Use the [CODE] tags when posting code because it will help to retain formatting and make your code easier to read. Also, consider pinpointing your code down to a particular section and post only that code...chances are you'll receive more responses as many people don't like to read through 50+ lines of code.

Thanks,
David
19 years ago
Yep, there is a setIcon() or something similar (can't remember from top of my head) in the JFrame class. Now, if you want to completely remove an icon altogether, you'll need to insert a blank image because if it is set to null, the default icon for your system will be used and most likely that will be the java coffee cup.

David
19 years ago
One approach you can take is to write your own class extending AbstractTableModel which will be used as the model for your JTable. If you do extend this class, there are 3 methods that need to be overwritten:

public int getRowCount();
public int getColumnCount();
public Object getValueAt(int row, int column);

Also this model is where you will handle making cells non-editable...changing cell renderers so that you can do things like implement JComboBox instead of the default renderer, etc etc.

Do a quick google on AbstractTableModel and you'll find plenty of resources.

David
19 years ago
Two patterns that I use frequently in my GUIs are: Command Pattern and Mediator Pattern. I think if you do a google on these, you'll get loads of good information.

Essentially, the mediator is what handles communication between classes so that you can keep knowledge from one class out of another class.

David
19 years ago
Yes, you can definitely use threads. In fact, anything that is going to take some time to process (i.e. database reads, i/o activity, etc) you should consider moving the processing of those tasks to another thread.

The problem if you don't is that they block your Swing Event Thread from processing any GUI activity which results in a perceived application lockup to the end-user because the GUI will not respond until the offending method call finishes and unblocks the EVT (event thread).

Make sense?
19 years ago
A little late, but I'll leave this here for reference:

//pertinent code only




Note: Your class needs to implement Printable

It's a little dirty, but it's rather old code from when I was learning Java and I didn't double-check it as I posted it here, but it's working in my application so.....

David
19 years ago
One approach you can take is to write your own class extending AbstractTableModel which will be used as the model for your JTable. If you do extend this class, there are 3 methods that need to be overwritten:

public int getRowCount();
public int getColumnCount();
public Object getValueAt(int row, int column);

Also this model is where you will handle making cells non-editable...changing cell renderers so that you can do things like implement JComboBox instead of the default renderer, etc etc.

Do a quick google on AbstractTableModel and you'll find plenty of resources.

David
19 years ago
Does anybody know how to dynamically observe the transfer rate being achieved by a threading reading URL input using the Apache Commons HTTPClient? For instance, I know how to calculate after retrieving a particular page...just using execution time versus file size, etc. I'm looking at retriving this info "on-the-fly" so-to-speak.

I googled for it and came up with some unrelated links.....I hope you can sympathize with me a little...I recently moved to Uzbekistan from Indianapolis and if I'm LUCKY I can get connected at 21kbps....and that's if my connection lasts for more than 5 minutes on these noisy phone lines. So, while I always try to google first and research it myself, it just wasn't happening this time around.

Thanks,
David
19 years ago