Jennifer Sohl

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

Recent posts by Jennifer Sohl

Hi there. I found some code on Sun's website that allows me to limit the number of columns and rows in a JTextArea component as follows:


This works fine...... however I still want the JTextArea to automatically line and word wrap. Using this DocumentFilter simply stops the input at the max char limit. How can I accomplish this?
Thanks for any help you can give me.
15 years ago
Hi there. I have some data stored in a DB2 database as a BLOB data type. I am retrieving this data from the database and putting it into an ArrayList as an InputStream object.

I then loop through the ArrayList of InputStream objects to output the images to a JTextPane.
This is the code I am using to insert the images:


However when it tries to execute the "while (is.read(buffer) > 0)"
it returns the following exception:

com.ibm.as400.access.ExtendedIOException: Resource not available.
at com.ibm.as400.access.AS400JDBCInputStream.read(AS400JDBCInputStream.java:201)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)

I can't seem to figure out exactly what is the issue here? Any ideas?
Thanks for any help!
Actually I am the one who set this up. I didn't drop the jars into the JRE ext directory. (I double checked just to make sure ) I'm actually using Eclipse to develop the project. Within that project in eclipse I imported the JavaMail jar files as reference libraries and exported everything into one jar. This app has been running fine on JRE 1.6.11 and 1.6.12 and 1.6.13. It just blew up when one user installed JRE 1.6.15. I'm stumped.
15 years ago
Hi there. I have an application that I am using to send email to users to notify them of certain events. It works perfectly fine if I am running JRE 1.6_12...... however once I upgraded to JRE 1_6_15 it now says it cannot find the class javax/mail/Message. I have all of the JavaMail jar files exported with my .jar file. JavaMail version is 1.4.1. Any ideas why all of a sudden this wouldn't work with the new JRE update?
15 years ago
Well, the app is supposed to allow the delete of a row from the table dependent upon the status of the order when it is returned from the database. Basically they key the order number in, if it has a certain status, then they are allowed to delete from the table otherwise they cannot. After the status is determined is where I'm adding the action listener to the table. (if good status) otherwise I'm removing the listener. What are the repurcussions of doing it this way? Thanks for your input! :-)
15 years ago
Genius!! That was exactly what was going on...... I was adding the ActionListener in the constructor and after data was returned to the JTable. I removed the code that was adding the ActionListener in the constructor and it works perfectly now.
Thanks!
15 years ago
Hi there. I have created a JPopupMenu that has one menu item on it. It comes up when a user right clicks a row in a JTable to allow them to delete a row. Then a method runs from the table model that deletes the row. The issue I'm running into is the ActionEvent is being executed twice instead of once. The following is the code in the ActionListener:



This is my JPopupMenu class (for the "rrtp" object)


The method deleteRows from the assemblies object (which is a JTable):


The method deleteRows from the tableModel:


What am I doing wrong? I can't seem to figure it out.
Thanks for any help!










15 years ago
Gregg,
This is the first time I have done an editable JTable with a check box. I googled some stuff on the internet and found an example from a forum on Sun's website that showed this was the way to do it. Since my curiosity was sparked from your post I removed the custom cell editor and it still works perfectly! Thanks for the input!
15 years ago
Thanks for the nudge in figuring this issue out. I've got it working now. I did not have the "setValueAt" method implemented in my table model. Once I did this then I was able to edit the cell.
Thanks again!
15 years ago
I have created a JTable that has a JCheckBox in column 2. The checkbox seems to be working okay except I can't seem to be able to check it or uncheck it. It seems to be un-editable. Can someone please look at my code and let me know where I went wrong?
Here's the table model:


Here's the editor:


Renderer:



And here's where I'm creating it all:


I really appreciate any help you can give me

15 years ago
Hi there! Just wanted to let you know..... I did some more poking around and believe I have resolved the issue....... instead of grabbing the BLOB using InputStream.... I used BufferedInputStream and it popped up lickety split! Thank you so much for all of your help!
Something else that is also really weird is once the attachment finally shows up in the JTextPane area (as a JButton), the JButton component (Jbutton) is constantly shaking (looks like it is rapidly bouncing up and down)....... anyone ever experienced this behavior before?
Thanks for the reply! The file that I am storing in my table (which is defined as BLOB(5M)) is a .pdf that is only 116K....... it takes about 50 seconds for the information to come up on the screen...... the line of code that seems to be taking a long time is when I call the getBinaryStream() method. Any ideas?
Hi there. I have written an app that reads a result set that contains a BLOB object. I have two different questions:

1). Is there anyway that I can automatically determine the file extension of the BLOB object in the database?

2). When I run the java app, it takes a VERY long time for the app to read the BLOB object(s). Can you look at the following code and tell me if I'm doing something wrong?




Thanks for any help!
Okay.... so I see how to retrieve the file... how do I store the file in the database as a BLOB? When the user click on the "attachments" JButton.... it opens up a JFileChooser for them to navigate to the attachment......I would assume I would have to do something as far as saving the path. How do I convert that file path into a BLOB object to save to the database?
15 years ago