The default password symbol of a JPasswordField is a dot. But this will be replaced by Java Look and Feel to an asterisk. Is there a way that I can replace this symbol to the dot back again after loading the Look and Feel ? I already know that initializing or creating the JFrame object before loading the Look…
Tag: swing
Is it possible to use Color Hex in JLabel like #02f7fc?
Is it possible to use Color hex in JLabel such as #02f7fc? I want to use A-F colors. Using label.setForeground(Color.(BLUE/RED/BLACK/…); is so boring. Answer The following should allow you to set the colour using hex with the use of the decode method.
Need help on Java Swing JFrame
I’m very new to Swing and I need to build a JFrame that: Has an image on top. Below the image has 16 little images divided into 4 groups (4 “panels”), on the same “row”. Below those 16 images I need 4 “panels” on the same “row”. Every panel contains some h…
How to use drag and drop in IntelliJ for java swing
I am using IntelliJ for java application development using swing . It is difficult to manage content using layout manager. So, is there is any facility to make drag and drop features like in visual studio for vb.net… Answer You can use IntelliJ’s GUI designer JetBrains website has some resources d…
How to change height of a jpopupmenu in a jcombobox?
I am working on an application in which I am handling key release event over a editable ‘JComboBox’, where on every key release a ‘JPopupMenu’ of the ‘JComboBox’ appears. I want to increase the height so that user will be able to see more items at a glance without scrolling…
Why does my for loop only return first value in JTable?
So I’m using this for loop to go through the values held in the first column. Then the if statement deletes the row if the value entered by the user is equal to the the value held in String hold. I am able to delete the first row but can not delete any row after that. What am I doing
How to open multiple windows with Processing?
I’m trying to create two windows with Processing. Before you mark this as a duplicate, as there are other questions similar to this, I have a specific error and I can’t find a solution. When I try to add(s) I get the error The method add(Component) in the type Container is not applicable for the a…
GridBagLayout gridwidth doesn’t work as expected
I’m working with the java swing LayoutManager GridBagLayout, and ran into this problem. I want a layout like this ACC BB But get a layout like this ACC B A and B take up the same number of columns despite B having a gridwidth of 2 where A’s gridwidth is 1. I don’t think there can be a vanish…
Referencing from an inner class
I have the following code My aim here is to create an array of JTextFields which have a keylistener on. This keylistener should prevent anything other than numbers being entered in the JTextField. It should also change the color of the JTextField’s background if the number entered is not an int. For exa…
Restrict JTextField to only accept certain characters
I have 4 JTextFields that should only accept certain characters: binary digits (0, 1) octal digits, so (0 – 7) all digits (0 – 9) all hexadecimal characters (0 – 9, a – f, A – F) The user must not be able to input a forbidden character. I know how I could validate the input after…