swing

Replicate Eclipse's "display tab" in my Java/Swing application?

So, I've got a Swing GUI that, for testing purposes (the other applications that my task will interact with aren't all developed yet), I'd like to be able to give a "debug console" to. The idea being that I could use this console to explicitly set values in my model, and verify that the appropriate GUI elements get updated. The Eclip...

JTable Editor Change with Live Data

I have a table model that is populated by live (external) data source that updates every xx seconds. The data is displayed in a JTable. The user can override the data in the table cell through an celleditor that extends the AbstractCellEditor. If the user clicks away, the code checks to see if the new value equals the value in the t...

Tile-like windows on Swing

I have zero experience writing applications with Swing, but I have one application with which to start experimenting. For this application, I want my window to have a variable number of small "tile"-like structures, which can be moved/closed/minimized just like windows by the user inside my main frame, and which will display, each a sma...

Implementing a log viewer GUI with C# (or java)

I'm writing a software component that displays on-the-fly the content of a certain log file. Think of boosted-up tail -f. It should be a part of a bigger GUI. I was wondering which GUI componenet should I choose to implement the scrollable textarea which should display the log file output. Three my main requirements are: Search - let...

Problem with JDICplus embedding IE in Java

I am building a Java Swing application that needs to support both an embedded browser and ActiveX. The easy way to do this seemed to be to use JDICplus, which just embeds IE in your application. That would have covered both requirements. I also need to overlay some buttons on top of this browser view so the user can navigate between vie...

Part of path returned from Directories Only JFileChooser is sometimes duplicated

In my application, I want the user to be able to select a directory to store stuff in. I have a text field that I'm using to display the directory they've chosen. If they just click on a directory (don't browse it), everything is fine. However, if they double click on the directory and look inside it, the directory name is duplicated. E...

Can I detect when the Garbage collector works?

Am working on a swing app. I will experiance slowness after continuous half an hour of use. can it because of GC running? How can i find when the garbage collector runs through any jdk 1.5 commandline option? Thanks ...

event attached with button clicking

I have a JFrame in which there are 2 textfields and 1 JButton. Users need to enter some string in the textbox. When user clicks the button in the JFrame then these strings get displayed in a JTable. I am not getting what code shall i write with button clicking. Please help me. Thanks. ...

sun.font.TrueTypeFont Memory Leak?

I've been profiling some Java software using heap dumps and there is 350 instances of sun.font.TrueTypeFont, in other heap dumps I have taken there have been more. There is only 5 instances of Font created by the app code, and 24 instances in all, mostly created by WDesktopProperties and other Java library classes. Is this number of Tr...

Architectural MVC and Swing

I want to use MVC to structure my Swing application, but there seems to be a conflict. As I understand MVC, the controller should handle input and update the model. The model should notify its observers of which the view is one. I have two problems Swing is all part of the view. The fact that components have their own models is an im...

Equivalent of Swing's pack in C#

I am developing a quick app in C#. One thing that I want to do is the equivalent of Swing's (java) pack(). This is a call that allows me to say to a form (Frame in Java), resize yourself to the size of the sum of the components within yourself. I have searched and searched (the components change dynamically so I cannot simply hardcode ...

Java Swing Range Slider U.I.

Hello. I needed a slider with two knobs on it (representing a range) and I found this nifty one here. However, they created their own U.I. which extends Java's BasicSliderUI. They override the paint method to draw their own knobs. I would like to use the default knobs based on the current look and feel. I tried calling BasicSliderUI...

pop a frame

I am working on a project (Java, Swing) in which i have to pop a frame on clicking a hyperlink. but the coding for the frame and all its components is done in a different class and that hyperlink exists in a different class. what shall i do to pop that frame on clicking of the hyperlink please tell. thanks. ...

Letting a Java Swing program layout itself again

I always have trouble with Java layouts, but the main thing bugging me now is that when the content changes, in particular changes it sizes, it's not laid out again properly. Take the example below: package layouttest; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swi...

Why shouldn't you extend JFrame and other components?

I've seen this come up here a few times, but in the postings I've seen, no one explained it. Why shouldn't I extend JFrame (or any component)? Are there conditions where I should extend a component, or is this a firm rule that you don't? ...

How to make a Swing application touchable?

We developed a Swing GUI system running on PC, and the boss wants it to run on a special tablet PC too. Does anyone know what else we can do to achieve it? How to make a Swing GUI support touch operation? The touch-support driver of the tablet PC is necessary, of course. ...

Why do Java's GtkLookAndFeel Popups have no border?

I have an already written Java Swing app (so no switching UI frameworks) that I would like to look at least decent using the GTKLookAndFeel. I've already accounted for things like font and component size differences across LookAndFeels, but one thing I can't figure out is why my popup menus have no borders at all. It appears they are u...

Drag rectangle on JFrame in Java

I want to draw rectangle based on mousedrag event. if user dragging the mouse, then the rectangle on the applet should increase or decrease basing on current mouse coordinates. i have the following code. in the following code i am using SelectionArea class which extends a canvas on which i am performing drawing operation. i am using ima...

Font Rendering in Mac vs Windows

I'm writing a Graphically intense application that renders a JLabel offscreen. When I call the following line, ellipsis appear on the mac but not on the windows box. g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); Now, I'm guessing that it's caused by Mac already doing some ...

How can I change te background color of a Java applet?

Greetings, So far, my code compiles, but it changes white to black and then don't want to change. Supposely it should change from red->orange->green->pink->blue->black.. public void init() { c=new Color[] {Color.red, Color.orange, Color.green, Color.pink, Color.blue, Color.black }; btnNext = new Button("Next...