Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
100 views

I have a JTextField for displaying the path of a selected folder. It's intentionally disabled (as the folder is supposed to be chosen with a JFileChooser), and when the program starts, a default ...
Holly LeBlond's user avatar
2 votes
1 answer
61 views

I have a simple JFrame with a JPanel inside a JScrollPane. The JPanel is used to show a vertical list of either JTextField or JEditorPane components: public class Test { void showFrame() { ...
BobColombo's user avatar
0 votes
1 answer
70 views

I have a JFormattedTextField that I want to only receive integer inputs (it will refuse anything else). NumberFormat test = NumberFormat.getIntegerInstance(); NumberFormatter test2 = new ...
TVXD's user avatar
  • 45
-1 votes
1 answer
80 views

The program technically works, but I keep getting the error: "Cannot invoke "javax.swing.JButton.addActionListener(java.awt.event.ActionListener)" because "this.check" is null&...
Eryk Smaga's user avatar
-1 votes
1 answer
78 views

I wrote this little program for an specific utility, didn't optimize it yet but so far everything works as intended, but when I accidentaly double click on JTextField it crashes, and I have no idea ...
Random Gamer's user avatar
1 vote
2 answers
76 views

import javax.swing.*; import java.awt.event.*; public class Test { private String textFieldValue; public Test() { JFrame frame = new JFrame (); JPanel panel = new ...
G Yu's user avatar
  • 11
1 vote
1 answer
62 views

as you can tell I am fairly new to Swing and ran into a small issue when building. Basically I want the user to be able to click on a button and a text field will appear. The issue is when I do ...
saladwaster's user avatar
0 votes
0 answers
55 views

I created a GUI using Java Swing and MigLayout that features a button ("Add new competitor") to add boxes containing JTextFields for user input. It initially starts with one such box, and ...
squiddigami's user avatar
0 votes
0 answers
126 views

In most situations I can enter Unicode characters by typing ctrl-shift-u followed by the hexadecimal character code. So for instance by typing ctrl-shift-u 2264 here in the browser I get "≤"....
jrv's user avatar
  • 461
0 votes
1 answer
30 views

i am attempting to make a soduku solving java program. i want it to be graphical and graphical isnt an area ive really explored before.first ive created a graphics method to draw all my needed lines. ...
Freddy Redpath's user avatar
0 votes
0 answers
56 views

I have a vertical BoxLayout with a few JTextfields. Whenever one of the fields is edited, I would like the field to come to the top: I do this by removing the field and re-adding it to the top. ...
Henry Copper's user avatar
0 votes
1 answer
58 views

I'm currently working on a small utility window for another application and I'm running into the issue that KeyListener input stops detecting input while a user is focused on a JTextField. I've made a ...
ObSp's user avatar
  • 31
1 vote
0 answers
83 views

"In my Java Swing project, I have a JTextArea which is jafAddress. In this JTextArea field, I set the font to SutonnyMJ Bangla font. However, when I write Bangla text into the JTextArea, Bangla ...
Md. Sabbir Hossain Onik's user avatar
1 vote
1 answer
55 views

I am relatively new to java, so i'm not the best at it. In my program, I have a board with an Array of JTextfields in which a player enters values and when they press the button, if it is a valid ...
NuclearBehem0th's user avatar
1 vote
0 answers
44 views

I've been having this problem for several days. I implemented the package, but I want to adapt it to my requirements. Each of the tags should be seen on the screen, one below the other, vertically. ...
flutter.dev's user avatar
2 votes
1 answer
145 views

I have a RoundPanel class that extends JPanel and provides a rounded appearance. JPanel user_icon = new RoundPanel(8); user_icon.setBackground(Color.decode("#363b41")); user_icon.setBorder(...
Mohamed Gharib's user avatar
0 votes
3 answers
109 views

I'm working with a Java Swing application and facing a challenge with customizing the JFileChooser component. Specifically, I need to change the background color of the JTextField used for editing ...
Vasiliy Sokolov's user avatar
0 votes
1 answer
65 views

If i try and add the jtextfield to another class after hitting my submit button it wont work because the other class trys to take the array list before it is updated import java.util.*; import java.io....
Abel Berhanu's user avatar
0 votes
1 answer
65 views

I am trying to format these JTextFields, and they were working fine. Whenever I add the 4th and 5th rows however, the JTextfields become like 1 character long (like in the screenshot). I don't see any ...
yeroc elleros's user avatar
0 votes
1 answer
90 views

So i have this calculator (on Java) and when i press a button i wanna check if in the JTextField(pantalla) is only "0" so i can replace it with the number instead of concatenate the button i ...
tumorito's user avatar
0 votes
0 answers
42 views

I'm working on a Java Swing application that involves the use of JTextField for user input. I want to restrict the minimum and maximum length of text that users can enter into the JTextField component....
user avatar
0 votes
2 answers
130 views

I'm fairly new to Java and stackoverflow. Please alert me if I make a mistake or if I provide insufficient information. I'm working on a Java Swing project and trying to use a custom DocumentFilter ...
Nichti's user avatar
  • 1
0 votes
0 answers
138 views

I have a Renderer class that extends JFormattedTextField In its constructor I set up Formatter and FormatterFactory in order to pass the input format limitations, but still have ability to input ...
Eljah's user avatar
  • 5,423
0 votes
0 answers
40 views

I would like to validate with each change the size of the text, perform an action! I put one while isolated, 2 ifs inside an ActionListener, created a separate method and it didn't work. The idea is: ...
dorzao's user avatar
  • 1
0 votes
1 answer
95 views

I have been looking through a lot of DocumentFilter examples, and have realized that my needs are a bit unusual: Three characters, maximum Only digits, 0-9, nothing else Automatically zero-filled to ...
R. Kåbis's user avatar
1 vote
0 answers
34 views

when I open my program the buttons, fields and labels are statically positioned. when I expand the JFrame the buttons, fields etc. are positioned badly. of course I tried to place them manually. but ...
Exootic 's user avatar
-1 votes
1 answer
256 views

When is try to get an input from the textfield it gives me an error message: "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke "javax.swing....
BrokenFloppyDisc's user avatar
-2 votes
1 answer
33 views

I'm having trouble adding my other JLabels and JTextFields in the JFrame. In my code I am trying to calculate the area of a triangle and want the user to add in the numbers for the sides. I have ...
chriscondreay's user avatar
0 votes
0 answers
56 views

I tried to create a translucent panel in java swing covering and underlying panel, but I've a problem: If, for example, there is a jtextfield in the panel below and the text of this component is ...
FBenevento's user avatar
-1 votes
1 answer
146 views

void addClick(JTextField field,String s) { field.addMouseListener(new MouseInputAdapter() { public void mouseClicked(MouseEvent e) { //when user clicks on amount text field, ...
Rakesh Reddy's user avatar
0 votes
1 answer
58 views

Here I want to call addComponents(i), but it says i is undefined inside the mouseClicked event function. Exact error: local variables referenced from an inner class must be final or effectively final ...
Rohan's user avatar
  • 39
-1 votes
1 answer
105 views

I'm writing a program in java that opens a window and detects keystrokes. However, there is one fatal problem. if i modify the value in TextField, KeyListener will not work again. Here is the code ...
noen's user avatar
  • 61
0 votes
1 answer
87 views

I've just come over to JAVA from BASIC, so please forgive me for any convention issues with my coding. I have a mildly infuritating GUI-related issue. I have constructed a matrix-multiplication ...
Thomas Farkas's user avatar
0 votes
0 answers
50 views

this the GUI I am trying to display the the inputs of my Jtextfield onto the text area but the contents are not displaying this is my code import javax.swing.*; import java.awt.*; import java.awt....
Allan Murimi's user avatar
-1 votes
1 answer
44 views

I have a problem with the following code, if filtered data appears to me, but it only filters it when the jframe starts, but not when I add a new one, I have to close the jframe and reopen it so that ...
DanielLaz's user avatar
0 votes
1 answer
73 views

I am new in Java and currently studying and trying out GUI. I have this problem that converts multiple integer into separated with comma. example is: 12333 = 1,2,3,3,3. It works in System.out.print ...
Cha's user avatar
  • 15
0 votes
0 answers
47 views

I'm trying to code my own little Java IDE in Java. I'm pretty far for what I want, because I only want to be able to code simple command-line-programs in my IDE. My current problem has to do with user ...
premaider's user avatar
0 votes
1 answer
63 views

I would like to know if there is a way to have a text validator, not the equals exactly, because I know if I do one by one it would take me a lifetime, but to validate all the autocompletion that I ...
DanielLaz's user avatar
-2 votes
1 answer
54 views

First I want to make second select function in my java. first is SelectAll which show all data of my DB. and second is select which show data that fits the conditions. Second I want to make a Checkbox ...
최영준's user avatar
-1 votes
1 answer
38 views

We are working on a bookstore project. Looking at the code below, I need to add up all the DB values ​​in the price column and then output the value to the jtextfield. How should I write the code...? ...
In Hwan Kim's user avatar
-1 votes
1 answer
114 views

I'm trying to synchronize two JTextFields. If I write in one JTextField, I want to write the same text in other JTextField simultaneously. I'm not sure what event use for this requirement. My example ...
Cesar Andres Abarca Piñones's user avatar
0 votes
1 answer
357 views

I'm wanting to create a jTextField that only has a bottom black line for a border in the simplest way possible. createLineborder doesn't seem to have a parameter for only the bottom line. ...
John Smith's user avatar
  • 3,645
0 votes
1 answer
36 views

package basics; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JTextField; import javax.swing.text.Caret; import java.awt.BorderLayout; import javax.swing.JButton; import ...
Ryan Guard's user avatar
0 votes
1 answer
68 views

I have modified NumberFormatter to have like a currency instance (with prefix). When I write the first number, this application have add the prefix to the number JFormattedTextField Empty but when I ...
DcSergio's user avatar
0 votes
1 answer
107 views

)) I'm new to Java, And I have such task: Create a text field component class. In the constructor, the default string must be set in the text field. When clicking on the field, this record should be ...
Arina 's user avatar
-1 votes
1 answer
347 views

So I want to store a string value in a variable, the value is given through a JTextField and after a confirm button is clicked, I want it to store what's written in the text field in a string variable....
Mr. Star's user avatar
-1 votes
1 answer
48 views

I'm making a program to insert users into a PostgreSQL database using NetBeans, and recently I've faced a problem that I'm asking myself if it's possible to fix? Basically, I wanted to select ...
killuaconfessions's user avatar
0 votes
1 answer
73 views

I've a JTextField with a JButton positioned inside of it on the east side. At the moment, when characters inserted reach the button the part of the text overlapping is inserted below of it. Here a ...
Squerut's user avatar
  • 65
0 votes
1 answer
56 views

private JTextField f1TextField; f1TextField.addKeyListener(new KeyAdapter() { @Override public void keyTyped(KeyEvent e) { ...
Jan Kowalski's user avatar
0 votes
1 answer
85 views

I have seen this question been answered. but not for BoxLayout. I have created a schedule app in Java and because I want to display every hour under each other, I have chosen BoxLayout. When every ...
asgr's user avatar
  • 35

1
2 3 4 5
60