Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. idarke

    Forcing repaint() in a loop with a delay

    Is the loop in a separate thread? If not, I suggest you move it into one. If the loop is in the same thread as the gui (buttons and keyboard polling, etc), the paint will not occur until the end of the loop.
  2. idarke

    changing font size in jlabel via html

    Try putting <html> at the beginning of the text, like this: label.setText("<html><font size=2>your text"); Closing tags don't seem to be necessary unless you're switching to another font within the same label.
  3. idarke

    usefulness of arrays...

    Arrays offer advantages in certain circumstances. For instance, if you have a method that must return a group of primatives (ints, longs), there's considerable overhead in wrapping those primatives in objects to include in a collection - even when the jvm is doing it for you as in java 1.5. An...
  4. idarke

    JTable copy to clipboard

    I'm willing to bet that after you click the button, the focus is still on the button. You're then copying the button object to the clipboard. You would either need to shift the focus to the JTable - I'm not sure how - or do it in such a way that the table never loses focus in the first place...
  5. idarke

    Painting an Animated GIF

    An ImageIcon will handle an animated gif alright. On ImageIcon there's a method called setImageObserver(). The ImageObserver is what triggers the animation. Here's the example in ImageIcon's source: * icon = new ImageIcon(...) * button.setIcon(icon); *...
  6. idarke

    In a constructor: pass 1 of its 'non final' args to a private method ?

    Yes, you have to make the table variable final IF you want to keep it as a local variable. If you move the table variable xxx to be a class variable rather than a local one, you should no longer get the message.
  7. idarke

    Resizing JButton not working

    I'm not sure what the default layout manager is for JToolBar, but you might try setting it (using JToolBar.setLayout()) to FlowLayout or BoxLayout or something to see if it works better for you. A little trial and error...
  8. idarke

    strange swing problem (objects not displayed)

    Could you possibly have an old swingall.jar on your classpath somewhere?
  9. idarke

    java.lang.OutOfMemoryError

    Java is a terrible memory hog. If the code snippet you posted is really all you're doing, then just increase the memory for the application and move on to more important things. If you're really interested, download a copy of Oracles JDeveloper and run your app under it. It has a built in...
  10. idarke

    HashMap contains method without Case senstive generating problems

    On the other hand, doing an iterator on a HashMap kind of defeats the purpose - you might as well use an ArrayList and save the extra overhead. What if you did a toUpperCase() on the String when you set it as the key in the HashMap, and toUpperCase on the string in the get method?
  11. idarke

    Servlet processing progress feedback

    Well, I implemented something like that once by having the servlet, after completing the first step, load a jsp that displayed the progress so far. The jsp had an OnLoad javascript method that immediately passed control back to the servlet to perform the next step. They kept bouncing back and...
  12. idarke

    Java Permissions Problems

    When programs stop working, the data is sometimes the problem. You're getting a null pointer exception when your reporting package tries to sort an array. This will occur when an array of Objects contains a null entry. In other words, it may not have anything to do with the client machines...
  13. idarke

    Input on database project

    If you want a database that the end user doesn't have to own, then you should look for ones that offer an "embedded" database driver. Both Pointbase (www.pointbase.com) and HSQLDB (hsqldb.sourceforge.net/) offer those options. I'm sure there are others.
  14. idarke

    Swing Tabbed Pane Changing Event

    I understand your problem. Even an InternalFrameListener doesn't get any events when the tab is changed. Basically the UI considers the tabbed pane as one big container, always displayed and active. What I ended up doing was making all my JInternalFrame objects globally accessable (I made...
  15. idarke

    Swing Tabbed Pane Changing Event

    Try this: jTabbedPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { // do something } });
  16. idarke

    File.lastModified() problem

    I figured out a workaround for the problem. After getting the Date object as above, I check to see if that date is within daylight savings time, and if it isn't, I add an hour to it. Here's the full handling: long tm = f.lastModified(); TimeZone tz = TimeZone.getTimeZone("US/Eastern")...
  17. idarke

    File.lastModified() problem

    Thanks for the suggestion. I didn't find setRawOffset on the Calendar object, but I did find one on the TimeZone object. That led me to try creating a SimpleTimeZone with no daylight savings time settings, but that had no effect. Here's what I tried: long tm = f.lastModified(); TimeZone tz...
  18. idarke

    File.lastModified() problem

    I have a file on my local drive (Windows 2000) with a last modified date/time of Jan 30, 2005 12:09:34 AM. When I create a File object for that file today, call lastModified() and make a Date object from it, the result is Jan 29, 2005 23:09:34 PM - one hour earlier. It seems to be making some...
  19. idarke

    SQLException: No data found

    I tried this experiment with three databases, using the jdbc drivers provided by each: DB2 under jdk1.3 (type 2 driver) Pointbase under jdk1.5 (type 4 driver) Hsqldb under jdk1.5 (type 4 driver) All three were able to retrieve the same column from a result set 20 times without...
  20. idarke

    SQLException: No data found

    ResultSet itself is abstract - the actual implementation of it is contained in the jdbc driver you're using. Another driver (for a different database, for instance) might work as you expect. That's why Sun doesn't guarantee the behaviour - it most likely didn't write the driver.

Part and Inventory Search

Back
Top