I am developing a Java Desktop Application which uses MySQL database. The DB has 6 tables. Every table, as usual, should allow CRUD (Create, Read, Update and Delete) operations.
I have designed 6*4 = 24 JPanels, 4 JPanels for each tables. Each JPanel have Components to take user input and perform the CRUD operation for which it is desig...
I have a model class that stores keys and values:
public class KeyValue {
private Object key;
private String value;
KeyValue () {
}
KeyValue (Object key, String value) {
this.key=key;
this.value=value;
}
public Object getKey() {
return this.key;
}
public void setKey(Object ...
Does exist in the JDialog class a way to prevent that a child window (JDialog) would be displayed more than once when the button from the main window (JFrame) used to open it, is pressed several times? Many thanks in advance!
...
I have a Swings GUI which contains a JComboBox and I want to load data into it from the database.
I have retrieved the data from the database in a String Array. Now how can I populate this String array into the JComboBox
EDITED====================================================================
In actual, the JComboBox is already inst...
I have a table in a database that contains two fields
id
name
I have populated a JComboBox "combo1" with all the names stored in the DB. Now I want that whenever a user selects an item of the "combo1", I can recognize the "id" of the selected item.
But the problem is that names can be duplicates in a table. So let assume if a table ...
Under certain circumstances, I need a JTabbedPane to remain on one pane until the user supplies certain information. Essentially, when this circumstance occurs, I need the current pane to become modal.
How can I implement this? I was thinking I could catch whatever event is triggered when the pane changes, and reset back to the pane I...
I am using a loop to invoke double buffering painting. This, together with overriding my only Panel's repaint method, is designed to pass complete control of repaint to my loop and only render when it necessary (i.e. some change was made in the GUI).
This is my rendering routine:
Log.write("renderer painting");
setNeedsRender...
Hi,
Is it possible to calculate the bounds of a htmlized String in Java Swing?
I tried using the BasicHtml.createHTMLView, but kept getting the same prefSpan; irrespective of the component font.
Regards,
Pavan
...
I'm working on a Swing based project that will display large amounts of data using a Table component. I'm trying to decide what are the best alternatives in terms of efficiency and management of the parsed data. The master table can be manipulated (i.e. views of the complete data can be created, or removed),so the complete data needs to ...
I am having an issue where I try and load some images using the ToolKit class, this is done like this:
Toolkit tk = Toolkit.getDefaultToolkit();
Image image = tk.createImage(imageFile.getPath());
but when I try to later draw these images onto my canvas (located inside JFrames) oftentimes it only draws some of the images on the ca...
I'm using the class "DynamicTree" provided by sun:here is the link
I wanted to know if it's possible to edit the code in some way to make the tree root name editable.
...
I am looking for an open-source java library for creating yahoo-pipes like GUI. Wireit is based on javascript. Prefer LGPL/Apache License that can be used for commercial purposes.
...
On clicking a button, I want the selected rows to be inverted (non-selected rows should be selected and selected rows should be non-selected).
Is there a build-in method in JTable to do it?
...
I have written one small code to add three panels to a main panel but the code is not working.
JPanel jp,child1,child2,child3;
JTabbedPane jtp;
public Panel4()
{
jtp=new JTabbedPane();
jp=new JPanel();
child1=new JPanel();
child2=new JPanel();
child3=new JPanel();
jtp.addTab("Child1",child1);
jtp.addTab...
I have a JComboBox named "jComboBox18" and a JTextArea "jTextArea11". Now I want that whenever a item is selected from the "jComboBox18" combo box its corresponding description is shown in the "jTextArea11" textarea.
I have added the appropriate listener to the JComboBox But the JTextArea is not showing any text. The code that I have wr...
I have a table in a database named "Process"
This process table has 3 fields:
process_id
process_name
process_parent_id
Now I want to display this parent child hierarchy in Graphical format. So could you please suggest me the following:
Q1. Which data structure would be better to use so as to get data from the database and store in...
Ok say I have a JPanel "controls" and jpanel "graphPanel" within another jpanel
public class outer extends JPanel implements ActionListener{
private JPanel controls,graphPanel;
private JButton doAction
public outer(){
JPanel controls = new JPanel();
JButton doAction = new JButton("Do stuff");
doAction.addActi...
How should I disable just a single column from dragging in JTable? I want to allow other columns from dragging but just the first column (indexed at 0). Thanks.
...
Most of the tutorials and documentation that I've been reading seem to indicate that most component communication takes place by subscription using listeners.
The Java docs indicate that java.awt.Component#dispatchEvent(AWTEvent e):
Dispatches an event to this component or one of its sub components. Calls processEvent before returni...
I always seem to have this internal struggle when it comes to user interface. I build up an application "engine" and tend to defer user interface to after I get my algorithms working. Then I go back and forth trying to decide how to let a user interact with my program. Personally, I'm a fan of the command line, but I can't expect that of...