myron schabe

Greenhorn
+ Follow
since Aug 21, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by myron schabe

How do I add just one day to a Date object?
Thanks
19 years ago
How can I test if a long is a negative rather than positive value?
19 years ago
Can anyone explain to me how image buffering/caching works in Java - I can't find this info readily on the Internet. My images are loaded on init and stored as static finals as ImageIcons.
Reason I need to know is I have a bug where the images in my application are occasionally getting visually corrupted. And upon refreshing they do not clean themselves up - we have not been able to determine a pattern as to when it happens - it is seemingly random at this point - except that it started to happen after we upgraded to a newer version of the Postgres DB, which should have nothing to do with this issue. We are using RMI though. There is a Java bug, Bug Id 4799519
Synopsis FullScreen: Some methods always returns false in Image & BufferCapabilities, which I suspect is the culprit. Anyone having similar problems or some insight?
Many Thanks
19 years ago
We had a strange thing happen to our application and I think it is a Java bug. The swing application with toolbar icons and other images was left running over night - during that time something may have happened where the resources got low and the gui (probably) started to redraw all haywire like it does - in the morning some of the images became corrupt - in that some of them were blank and others were all haywire looking but stagnant and others were fine. And they didn't clean themselves up - they are just staying in that corrupted looking state. If you restart the app - the images look fine. Does anyone know of a work around for this or should I log a bug for Sun - we are using 1.4.1_01 - I've already looked in Sun's bug database and couldn't find this exact problem. The one thing is my ImageIcons are loaded on init and are static finals - I don't know if this is a factor. It seems like Java cached them in some funky state and saved them that way.
19 years ago
Does anyone know of a way to 'share' JMenuItems with both JMenus and JPopupMenus - for instance:
JMenuItem mniExample1 = new JMenuItem("Example 1");
JMenu mnuExample = new JMenu("Examples");
JPopupMenu pmExample = new JMenu("Examples");
mnuExample.add(mniExample1);
pmExample.add(mniExample1);
What happens when I do this is that the Example1 menuItem only shows up in the popup menu not both.
Thanks
19 years ago
Does anyone know of a design pattern or elegant way of coding the enabling/disabling of components for a large Swing Java Application (i.e. lots of toolbars and menus - that need to be turned off an on depending on where a user is on the screen)?
Many Thanks
19 years ago
To Nate:
Yes, I am creating the JOptionPane with one of the various frames as a parent.
But can you, using the JDesktopPane and JInternalFrames model, have 'free floating' frames - because I don't want to have frames embedded within one outer encompassing frame(ala mdi).
And, yes, most of the time when you click on the parent frame's button on the taskbar the modal comes up on top of parent frame - but I have seen it slip behind the parent in some cases - but moreover I am getting complaints that even when it works correctly( when modal appears on top of the parent frame upon maximization )it is confusing for a user. So, I am looking for a possible work around.

To Bill:
Yes, if you have sample code that would be great - I am not in dire straits with time.
19 years ago
Hi,
I have a big java application that is comprised of several frames for different business functions. The app throws errors and warnings with modal JOptionPanes - very normal/standard right. I am having a problem, though, with the task bar in that if some of my frames are minimized on the task bar - and one of my maximized frames pops up a modal JoptionPane - the modal JOptionPane can get covered over by the maximizing of a minimized frame. Has anyone else seen this problem and if so - what is the fix?
(The resulting situation is the app seems to lock up because the user can't find the modal dialog.)
Many Thanks
19 years ago
Many Thanks,
Putting in the classpath works like a charm.
19 years ago
How can you access a file that is within a jar file in a java application. I thought that there was really no difference between accessing an uncompressed file or if it was in a jar file - but I can't get it to work. I.E.
URL hsURL = getClass().getResource("fileName.htm");
With fileName.htm being inside jarFile.jar.
Do I have to do anything(programmatically) with jarFile.jar
Many Thanks,
And I apologize in advance if this is the wrong forum.
19 years ago
Thanks - you were right - I double checked my code and I was doing something stupid - so the \n does, in fact, work.
Many Thanks!
19 years ago
Is anyone familiar with how to format the body of email messages - namely I just want to to have multiple lines in my email rather than one long mashed together string. I have already tried just using a string with \r's and \n's embedded in it, which has not worked.
I am using the javax.mail api's.
Many Thanks
19 years ago
How can I code a JTree to just create nodes for what is in the viewable area? (i.e. if JTree is in a scrollPane, which is say 600 high to only create and show the leafs/nodes that would show up in the 600 pixel high scrollpane).
Also, any advice regarding scalablity/performance solutions/patterns with a JTree would be very helpful.
Many Thanks
19 years ago
Hi,
Want I want to do is have a JTextArea display strings as it is being added - sort of like showing progress. The code snippet I have below just (visually)dumps the contents into the text area when the loop is completed. What I want is the JTextArea to visually add the strings line by line as it is looping - so a user know that something is going on rather than a big long wait then a dump. Of course, setText() vs. append() doesn't work either as that doesn't concatentate. Validates or repaints don't seem to help. I am missing something. I can use another widget if it provides the desired affect.
JTextArea textArea = new JTextArea();
for(int i = 0; i <= 10000; i++)
{
textArea.append("blah blah blah blah...\n"); textArea.validate();
scrollPane.validate();
}

Many Thanks!
19 years ago