I wanted to make a Glass Panel that contain a JPanel with white background, border and the msg “please wait”. Here is the code example: It will fade in and out while waiting for the query. the problem is that I am getting a bad result. need help Answer the other is that none of them show it with glass
Tag: swing
Java quiz with multi choices in answers
I’m trying to develop a java quiz, here’s the basic idea: A quiz contains n questions, and a question has 0 to n true answers, I have to link that to a database, so my tables are: Table Quiz: Table Question: Table answer: So my java classes are: My Question class: and the same for Answer: The main JFrame contains
Is there anyway to get the size of the text in a JTextArea?
The title pretty much says it all. What I don’t mean is how to get the size of the JTextArea. I need to get the size of the actual text. I am completely open to suggestions though. If you have a wonky workaround that involves using something other than JTextArea but still has a similar effect, I’d love to hear
JTextField render bug if Text-Not-Fitting (JDK 7 till 18)
JTextField has wrong text render on RIGHT_TO_LEFT component orientation We need a workaround, since whenever JTextField is filled with text that contains: Right to left text like Arabic, Latin numbers, and Latin text. Then JTextField renders text parts at unexpected locations. (It only renders right if the complete text Fits inside the JTextField.) The text we use to reproduce is:
JTextField size can’t be changed
} I tried to create a form and a JTextField on it. But the problem is, my location and size doesn’t work. The TextField is filling the whole form. How can I fix it? Answer The size is not “working” due to the default layout (FlowLayout) in your JFrame. This layout doesn’t let you change the size or location of
Java Swing JScrollPane not scrolling when shift held down and using mouse wheel
I have a simple Java Swing program defined below: The program consists of a simple JScrollPane with multiple buttons inside of it. Only vertical scrolling is enabled. It works fine. However, the problem is, when I am holding down the ‘shift’ key, vertical scrolling does not work when I am using the mouse wheel to scroll. Vertical scrolling only works
Performance of JavaFx Gui vs Swing
I wrote two simple programs, both draw the same Sierpinski Triangle: One program was implemented using swing, and one using javafx. There is a very significant performance difference, swing implementation being consistently much faster: (In this test case : Swing over 1 sec. Javafx over 12 seconds) Is it to be expected or is there something very wrong with my
JPanel takes the entire space of JFrame
I am struggling to place some simple objects using the FlowLayout manager in Swing. Basically I have created a small program, I have set up the size of the frame, then crated some JLabels and then one JPanel. I have put the JPanel a setSize of 300×300 and changed it’s color to red to visually see it. However it takes
JavaFX WebView in Java Swing Project
i try to use the WebView in my java project, in my code is: but the this thown a exception And yes, this is not a JavaFx application. Answer You can embed JavaFX content into a Swing application using JFXPanel. Note that for this to work correctly, you have to be careful to create and access the Swing content on
Latency in Iterator or foreach
i have one ArrayList that has a 1000 Insert SQL statement. but rather in execution time the latency of Iterator or (enhanced for loop) for this ArrayList take 1 minute . and my JFrame is not responding in this period. what can i do? Thanks Answer foreach internally uses iterator only, in order to handle bulk updates and inserts from