Hello. I am writing a program from class, and I am attempting to have it set up so a window is created which shows search results in the form of buttons. I would like it if there are no search results, that the window would call a pop-up warning stating such and then just close the window.
I have it setup that whenever I want to mak...
Till now, I had been using Netbeans Swing GUI generation feature to build GUI for my java applications.
Now I have started using Eclipse for my projects and have dropped Netbeans. So apart from coding manually all the code for GUI, what are the other ways with which I can build GUI quickly and in a much better way.
...
Hi
I have a question about mirroring the JDialog window controls (ie the close sign 'X', the title and so on)
When I apply the right-to-left component orientation for a JDialog, it flips everything within apart from the window controls. I initially thought this is to do with the JRE I was using and the operating system regional languag...
Hi,I want to add component into JTextField as a popup like this.
i want to add my component for example JPanel...
...
Hi folks,
I found the JXMapKit from SwingLabs and think I am going to use it. My problem now is that I have data referencing the point via the zip code (I don't need more accurat). I know that with the JavaScript API from Google it is possible to find out the geoposition from an address... My question now is: does this work with Java Sw...
Hi
I created a method which changes the icon of all jradiobuttons from a buttongroup:
public void setRadioButtonIcons(final ButtonGroup gruppe){
Enumeration<AbstractButton> gruppeEnum = gruppe.getElements();
while (gruppeEnum.hasMoreElements()){
AbstractButton radio = gruppeEnum.nextElement();
Icon unselI...
I have a program that takes a long time to load. Because of this I wanted to develop a splash screen that can provide feedback to the user on what is being loaded. A simple JFrame with an image, label and JProgressBar.
I have been experimenting and the best results I've had are doing this in my main():
SwingUtilities.invokeAndWait(new ...
I have a JTextPane and I am able to modify the style of a portion of text within it.
Assuming that nothing in the JTextPane is selected, I would like to be able to modify the style of a portion that is not yet in it, that is to say, to set the style that the user is going to type next.
Using setCharacterAttributes(start, length, style,...
For a specific screen, I'm looking for a JList that I could filter (the same way you can filter a JTable using a RowFilter)
Is there a good implementation of this kind of component anywhere here in the wild (and do you have an experience with it) or do I have to code it myself ?
(it is not that long to do, but if there is any valid imp...
How can I perform action in background at program start? I would expect some kind of onLoad event for this purpose. Just to be clear: Load ui. Do some stuff and load some more UI based on result of my event.
...
For example, say I have a series of toolbar-style buttons across the top of my application's main window. I want to attach a mnemonic to one of these that's just a single keypress, like F3.
When you set the mnemonic to KeyEvent.VK_F3, the user has to press Alt+F3.
If you have a menu item, you can set an accelerator, rather than a mnem...
I don't want to set the background color for all the cells in the jtable, just the ones I choose. How do i go about doing this?
...
Please, help!
How can I update my JFrame content(add new JPanel, add button, etc) after some action take place, like press button?
Thanks!
...
I have used this statement for setting an icon for a frame but still it shows the "java" instead of my image,would you please help me?
frame.setIconImage(Toolkit.getDefaultToolkit().getImage("tictactoe.gif"));
...
I have a custom ButtonUI class that paints the button. Before drawing the text, the paint method checks whether the button has been set a custom color in order to use that instead of UIDefaults#get("Button.foreground").
if ((b.getForeground() != null)) {
colText = b.getForeground();
}
Having a look into the java.awt.Component clas...
I have a Java JApplet embedded in a web page.
The JApplet window contains a single instance of a class that extends JPanel - same size as the JApplet.
The applet can spawn pop-up windows (JFrames) when the user clicks a button that's in the panel.
Every time I click on a button to pop-up a window, my applet flickers as it repaints. It ...
Hi All,
I want to set upper bound for a number in formatter textfield. Let's say that there is a string which has following format:
036 12' 23.67"
The first number must be less than 180, so when the user tries to type a number greater than 180, it must be masked.
I used MaskFormatter to format string as above, but I couldn't set an up...
In the application that I am working on, there is tabular data (for the record, it is a Java Swing app using JTables). In some cases the data is sortable by clicking on the column headers.
What I want to know is what is a good way to indicate to the user if a given column is sortable or not?
I have come up with the following possibiliti...
I'm creating a graphical roguelike game using Java. In the game, I'm painting a 2d array of Tile objects onto a JPanel. These Tile objects represent the ground. I have a .bmp sprite sheet that contains all of the textures I want to use to paint with. Every time the player moves, the tiles that are visible to the player need to be redrawn...
I've implemented a TreeCellRenderer that returns a JCheckBox (simple code that the renderer extends a JCheckBox and sets its selection status based on a flag in the item) and it works well. However, when there are more than a few items in the list, it renders VERY slowly. Scrolling in the list and expanding nodes takes over 1 second, whi...