No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I have problems with my GUI part... I have put all components on the JFrame but I would like to add some backgrounds and decoration. However, when I add background using JLabel. Everything loses its position and they are all ruined... Is there anyway to resolve this? | |
protected void addBindings() { InputMap inputMap = this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); ActionMap actionMap = this.getRootPane().getActionMap(); KeyStroke key = KeyStroke.getKeyStroke(KeyEvent.VK_Z, Event.CTRL_MASK); inputMap.put(key, "undo"); actionMap.put("undo", new UndoAction()); key = KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.CTRL_MASK); inputMap.put(key, "completed"); actionMap.put("completed", new CompletedAction()); key = KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK); inputMap.put(key, "delete"); actionMap.put("delete", new DeleteAction()); } class UndoAction extends AbstractAction { @Override public void actionPerformed(ActionEvent … | |
Now I have 2 classes. The first one is called UIController and the other one is called MainJFrame. I would like to know how to make a listener for a JFrame which has a JComboBox inside. Everytime a ComboBox submit a new data the JFrame will tell the UIController that … | |
This program is one part of the GUI part for my reminder program. I would like to update the JTable which shows all the task and will refresh every 2 second. I have questions... (1)the SwingWorker never executes( I put println in the code but it shows nothing ) How … | |
I have problems with adding images to JFrame java application. Now I am using Eclipse IDE. Below is the code that no images is shown. import java.awt.BorderLayout; import javax.swing.ImageIcon; import javax.swing.JLabel; import javax.swing.JFrame; public class LabelDemo { public static void main(String[] args) { JLabel northLabel = new JLabel("North"); ImageIcon labelIcon … |