swing

How do you implement position-sensitive zooming inside a JScrollPane?

I am trying to implement position-sensitive zooming inside a JScrollPane. The JScrollPane contains a component with a customized 'paint' that will draw itself inside whatever space it is allocated - so zooming is as easy as using a MouseWheelListener that resizes the inner component as required. But I also want zooming into (or out of) ...

Looking for a Swing Run-In-Background GUI library

Most modern apps provide an interactive way to push a long running operation onto a background queue. I am developing a swing application and I have implemented a simple "framework" to support that. However, I can't help but think that something like that must exist already. I have heard that Netbeans provides that, but I don't want to m...

Fast search in java swing applications?

I'm wandering myself what component is the best for displaying fast search results in swing. I want to create something like this, make a text field where user can enter some text, during his entering I'll improve in back end fast search on database, and I want to show data bellow the text box, and he will be able to browse the results a...

Which Layout Manager do you use?

What java GUI layout manager does everyone use? Lately, I have been using MigLayout, which has some powerful component controls. Just wanted to see what other developers are using other than the standard JDK ones. ...

Dynamically added JTable not displaying

Java Newbie here. I have a JFrame that I added to my netbeans project, and I've added the following method to it, which creates a JTable. Problem is, for some reason when I call this method, the JTable isn't displayed. Any suggestions? public void showFromVectors(Vector colNames, Vector data) { jt = new javax.swing.JTable(data,...

Java, Swing: how do I set the maximum width of a JTextField ?

I'm writing a custom file selection component. In my UI, first the user clicks a button, which pops a JFileChooser; when it is closed, the absolute path of the selected file is written to a JTextField. The problem is, absolute paths are usually long, which causes the text field to enlarge, making its container too wide. I've tried this...

Java Swing: Ctrl+F1 does not work globally, but each other key combination

Hello, I have a swing gui with a tabbed pane in the north. Several key events are added to its input map: InputMap paneInputMap = pane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); paneInputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_E, KeyEvent.CTRL_MASK ), "finish"); paneInputMap.put( KeyStroke.getKeyStroke( KeyEvent.V...

Which GUI Library is the best in Java?

Which GUI Library is the best in Java? I'm very confused. Swing is very slow and very ugly. Can you guys tell me about a good GUI library that I can use in Java? ...

JFrame.setDefaultLookAndFeelDecorated(true);

when i use setDefaultLookAndFeelDecorated(true) method in Java why is the Frame appear FullScreen when i maximize the Frame ? and how can i disaple the FullScreen mode in this method ? ...

Are there any frameworks for handling database requests in swing applications?

I believe any programmer who has been dealing with database requests in a gui application has run into some or all of the following problems: Your GUI freezes because you call database layer from within the event dispatch thread When you have multiple windows/panels/jframes where user can start a db request your performance degrades be...

How to centre a Window in Java?

What's the easiest way to centre a java.awt.Window, such as a JFrame or a JDialog? ...

Best Java/Swing browser component ?

What's the best cross platform Java Swing browser component at least able to play nicely in a swing interface (lightweight component ?) and able to run on MacOSX and Windows ? Things like : FlyingSaucer, JDIC, maybe others ? ...

How can I setup LookAndFeel Files in Java ?

I need to setup LookAndFeel Files in JDK 1.6. I have two files: napkinlaf-swingset2.jar napkinlaf.jar How can I set this up and use it? I would like a GTK look and feel OR Qt look and feel, Are they available? ...

JTable column spanning

I am trying to make a JTable that has column spans available. Specifically, I am looking to nest a JTable inside another JTable, and when the user clicks to view the nested table, it should expand to push down the rows below and fill the empty space. This is similar to what you see in MS Access where you can nest tables, and clicking the...

Why does Swing in my Java Applet flicker on fast mouse over?

I made a Java Applet with some Standard GUI Components on it. I used the MigLayout Manager. If I move the mouse slowly over the various GUI Components everything appears to be fine, but if I move the mouse fast, it flickers. What could make that nasty ugly redraw? (Core 2 Duo 6300, 2GB Ram, Windows XP) ...

What is the best "closable TabbedPane" Component in Java?

After solving my flicker issue, I wonder if there is a better closable Tabbed Pane, then the one that pops up on top by googling for closabletappedpane? (you recognize it by its processMouseEvents Method) I especially need one, that never flickers :-) Please post your experience, links with your own closable Tabbed Panes here. ...

Scrollable JDesktopPane?

I'd like to add scrolling capability to a javax.swing.JDesktopPane. But wrapping in a javax.swing.JScrollPane does not produce the desired behavior. Searching the web shows that this has been an issue for quite some time. There are some solutions out there, but they seem to be pretty old, and I'm not not completely satisfied with them. ...

Loading animated gif from JAR file into ImageIcon

I'm trying to create a ImageIcon from a animated gif stored in a jar file. ImageIcon imageIcon = new ImageIcon(ImageIO.read(MyClass.class.getClassLoader().getResourceAsStream("animated.gif"))); The image loads, but only the first frame of the animated gif. The animation does not play. If I load the animated gif from a file on the f...

Java TreeNode: How to prevent getChildCount from doing expensive operation?

I'm writing a Java Tree in which tree nodes could have children that take a long time to compute (in this case, it's a file system, where there may be network timeouts that prevent getting a list of files from an attached drive). The problem I'm finding is this: getChildCount() is called before the user specifically requests opening a...

Is there a good drop-in replacement for Java's JEditorPane?

I'm not happy with the rendering of HTML by Swing's JEditorPane. In particular bullets for unordered lists are hideous. Customising the rendering seems extremely difficult. Therefore I'm looking for a replacement with better HTML rendering. Does this exist? (I asked Google, and found nothing except a promising dead link). ...