Is it possible to just send a JPanel or any other component to the printer? Or do I have to implement all the drawing to the graphics object by hand?
I have tried to use the Print* functions of the JPanel to print to the graphics object but the page that gets printed is blank.
...
I have experienced performance problems for JDialogs while running my GUI remotely over X11. Does anyone know a workaround?
The GUI is fast when I run it on my local machine, but sometimes we need to run it on a remote server - which causes a significant lag until the dialog is displayed. It takes about 2 seconds to create and display t...
I have a JQueryDialog with a text field, an OK button and a cancel button.
I want to be able to hit the enter key after filling in the text fields and have it do the same action as when I click the OK button.
...
Hi guys, I have a problem.
I'm working on another guy's code and there is a JFrame with lots of JSeparators(he used them as borders for 'panels') now I'm replacing them for a JBorderedPanel class that follows the same border style of the whole application.
The problem is that some of his separators are not clear to determine where the...
How can i make my Java Swing GUI Components [Right To Left] for Arabic language from NetBeans Desktop Application?
...
How can I create a JButton in Swing with the icon above the text?
...
The bloated JFileChooser seems to be missing one feature: a way to suggest the file name when saving a file (the thing that usually gets selected so that it would get replaced when user starts typing).
Do you know a way around this?
TIA.
...
Here's the basic idea:
There is a java window (main) that opens another java window (child). When the child is created, part of the initialization sets the focus in the appropriate text field in the child window:
childTextField.requestFocusInWindow();
childTextField.setCaretPosition(0);
The child is generally opened through a seriou...
In my company, I am implementing a java based html browser. I found a lot of tools to generate complete browsers only in Swing which are looking like Mozilla. But I was not able to find a browser which supports JavaScript. The browser I will implement should execute JavaScript inside the HTML sides.
Do you know of a tool that supports t...
For my application, I want a Combo Box that displays its elements when dropped down as a Tree. Problem is, I'm not versed well enough in Swing to know how to go about doing this. At least without ending up writing a new widget from scratch, or something to that effect.
How would I do something like this without creating one from scrat...
I have a java object with several members. I want to create a small, quick and dirty editor that allows me to set the value of the members in an easy way. I've created a Panel that contains a TextField for every member. I have a setValues() method that will take the value of the TextFields and set them into the object. This method is...
I am looking for a tool/framework to (automatically) generate a Swing user interface to perform CRUD operations on an underlying database.
I would also like to configure the database fields that should be exposed. Something like django (via modelforms) or ruby on rails features, but in a Java desktop environment.
...
JCheckBox special = new JCheckBox ("\nSpecial - $17.95" + "\nMeatball, Sausage, Mushroom, Onion, Pepperoni & Pepper");
In this line of code, how do you make the checkbox make the "..." into two lines?
...
I want my JTextPane to insert spaces whenever I press Tab. Currently it inserts the tab character (ASCII 9).
Is there anyway to customize the tab policy of JTextPane (other than catching "tab-key" events and inserting the spaces myself seems an)?
...
I'm using TableLayout for my swing GUI. Initially only some basic labels, buttons and text fields where required which I could later on access by:
public Component getComponent(String componentName) {
return getComponent(componentName, this.frame.getContentPane());
}
private Component getComponent(String componentName, Component co...
I've been working with Java GUI for a while now but the whole model/structure of JFrames, paint(), super, etc is all murky in my mind.
I need a clear explanation or link that will explain how the whole GUI system is organized.
stackoverflow-ers: can you help me?
Thanks everyone, some more answers would be better but this is great!
...
I have a JPanel full of JTextFields...
for (int i=0; i<maxPoints; i++) {
JTextField textField = new JTextField();
points.add(textField);
}
How do I later get the JTextFields in that JPanel? Like if I want their values with
TextField.getText();
Thanks
...
I have a JTable with a custom TableModel called DataTableModel. I initialized the table with a set of column names and no data as follows:
books = new JTable(new DataTableModel(new Vector<Vector<String>>(), title2));
JScrollPane scroll1 = new JScrollPane(books);
scroll1.setEnabled(true);
scroll1.setVisible(true);
JSplitPane jsp1 = new J...
Hi,
I got a table with a custom TableCellEditor (extending DefaultCellEditor) with a JFormattedTextField as the editor component.
Now I got problem: when I press a separate button while editing. When the button is pressed, the editor remains "open and active" while I'd want it to stop editing so that the changes made would be available...
I’m working on an in-house app that tracks a bunch of tasks. I wanted to have a simple task monitor that would list the task name and the task’s status. I need this to look just a little nice, I’m no designer so whatever I do is going to suck, but a basic text display won’t work for the project requirements.
What I am essentially attemp...