Okay, now I've been using drawImage in java for a while, and this has never happened before. Why can't it find "drawImage(java.awt.image.BufferedImage,<nulltype>,int,int)" in my code?
import java.awt.*;
import javax.swing.*;
import javax.swing.JPanel;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java....
I am doing some research on how to "draw"
some attributed text on Graphics2D.
So, i am interested is it possible to save
content of AttributedString in some format ?
I know it could be Java serialized,
but, i don't need that solution here.
Also, if somebody knows some example which shows
how to edit AttributedString ?
Here is some Ja...
Some users of our Swing application have reported weird artefacts appearing on the display. This ranges from components not repainting themselves properly for a second or two, right upto whole portions of the application being repainted like tiled wallpaper over areas of the window.
The app has been worked on by developers of all levels...
What I am trying to do mimic an HTML Select tag. I want to display text as an option but when selected, I would use its value.
For example, I would have a list of country names. However, when a user selects Japan, I want to get the Locale Code for that country. So the user sees that they selected Japan, but my code will get "ja_JP" or s...
I'm just getting started with javafx in NetBeans, and I have it doing simple stuff (windows with buttons + the like) but would like to try something slightly more realistic.
The "Swing/AWT Components" palette has a whole bunch of stuff that the "JavaFX Script Code Clips" palette does not (it has Button, CheckBox, ComboBox, ComboBoxItem,...
A time counter shows the age in seconds of a row in the table. Ideally, it would be updated once per second. I know I can just increment the appropriate data in the table model, fire the events (one per row), etc. It seems like overkill. Is there a better, lighter way?
...
This question is not so much a "How to create a gui", but more of a "where to create the gui".
I have some java code that checks to make sure the drivers needed are in place:
public boolean confirmDrivers() {
/* some logic */
return someDriver.exists();
}
it gets called as:
if (confirmDrivers()) {
createGUI();...
In java swing I can insert panels into panels and so on, and not have to build a brand new window for every view of my applicaiton, or mess around removing and adding controls.
Theres a panel clas sin C# however I cant see any way of creating a 'panel form' or basically just a form in form designer thats a panel and its contents.
How d...
I want to delete them, because for some reason my forms are restored to the wrong dimensions on startup.
I didn't find anything in my user directory, but I'm not event sure what to look for.
I'm interested about Windows and Linux.
...
I have an application that uses disabled JTextFields in several places which are intended to be transparent - allowing the background to show through instead of the text field's normal background.
When running the new Nimbus LAF these fields are opaque (despite setting setOpaque(false)), and my UI is broken. It's as if the LAF is ignor...
I'm trying to write a nice GUI in Swing that uses the proper Model-Delegate pattern as much as possible. I have a JComboBox that when changed, needs to update the model with the new data. To get the currently selected item, I am using:
fooCombo.addItemListener(new ItemListener() {
public void itemStateChanged(final ItemEvent arg0) {...
I would like to be able to change the locale in my Swing application at runtime and have all the text elements on the screen update themselves with localized text from a ResourceBundle of the new locale.
Can this be done without customizing swing components or creating UIDelegates for all components that handle rendering localized text...
I'm trying to figure out how to make a virtual listbox (or tree or outline) in Swing -- this would be one where the listbox can show a "view" within a large result set from a database without getting the entire result set's contents; all it needs to give me is a heads up that Items N1 - N2 are going to need to be displayed soon, so I can...
I was wondering if anybody had any experience trying to run a complex SWT UI hosted inside a Swing component.
I've managed to get a very simple demo going but if anyone else has tried and failed / succeeded to do this it'd be great to learn from their experiences.
So to reiterate my application is a Swing app I wish to make use of a co...
I am currently trying to build an expanding panel in Swing (akin the WPF's Expander control) and I'd like to retain the usual methods for manipulating it (i. e. setLayout, add, etc.). Only they should be routed to an embedded panel (the one being shown or hidden).
How would one do that? Overriding every method of JComponent and re-routi...
I am currently trying to implement a Swing component, inheriting from JLabel which should simply represent a label that can be oriented vertically.
Beginning with this:
public class RotatedLabel extends JLabel {
public enum Direction {
HORIZONTAL,
VERTICAL_UP,
VERTICAL_DOWN
}
private Direction direction;
I thought...
I'm making a Scorched Earth like game in Java (for my exam project :D), but I have this problem. I'm drawing a window (JFrame), setting layout to BorderLayout, applying an extended JPanel, and packing the window, but after it has been packed, it's showing some extended white space at the left and bottom border.
This is my main class:
p...
I have a JList which i want to use to display a list a caches that are added in from another form, I've got this working and I want to be able to add the caches directly to the list... Is there a way to change what gets displayed to the user? or would it simply be a case of making to the toString method of my object what i want to be dis...
Which sort of listener do I have to add to a JFrame to detect when it is being hidden/shown via setVisible?
I tried using a WindowListener and the windowOpened and windowClosed methods, but they only work for the first time that a window is opened (windowOpened) or, respectively, when the window is closed using the dispose method (windo...
I would like to hear some opinions on hand coding your GUIs as one typically do when using Java or Qt with C++, vs using a gui-designer tool? Examples of GUI designer tools would be MFC GUI-designer, Qt designer, Interface Builder (Apple).
I used to be a fan of hand coding but from recent experience I have switched. The problem I have s...