Questions tagged [swingutilities]

121 questions
1
vote
1 answer

How to add mouse listener to a JPanel image?

I have painted a BufferedImage on a JPanel with the following code. protected void paintComponent(Graphics g) { if (image != null) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; double x = (getWidth() -…
Rendicahya
  • 4,205
  • 7
  • 36
  • 56
1
vote
1 answer

html files encryption for client side

I am using lucene for indexing and searching on client side after searching the keyword i want to display the html files there . So is there any way to store and access the html files . actually the html files are storing images and links and they…
adesh kumar
  • 129
  • 3
  • 10
1
vote
2 answers

Java SwingUtilities.invokeLater() timing with drag and drop

Java Swing's SwingUtilities.invokeLater() allows you to enqueue a thread to run after the last AWT event (user gesture) is processed. Is invokeLater() guaranteed to wait until after the completion of a drag and drop gesture?
Daniel
  • 855
  • 10
  • 21
1
vote
2 answers

java applet: JProgressBar updating/refreshing only at completion

I'm just trying to iterate in for loop and updating values of JProgressBar inside the loop, initiating SwingUtilities.invokeLater.. but it's only updating after completion. Below is my simple code: import java.awt.Color; import…
Ashish Kataria
  • 520
  • 3
  • 11
  • 31
1
vote
1 answer

SwingUtilities.invokeLater not working as expected

I am working on a concurrent canvas written in Java which will make the users think that they are drawing on the canvas in parallel. In order to achieve the user perceived parallelism, I get them to create these Runnable objects that I go ahead and…
freakii
  • 27
  • 7
1
vote
2 answers

Scrolling to the other part of the webpage

I am rendering a webpage and trying to scroll to a location within it. However, the scrolling doesn't work. This is my code... import org.lobobrowser.html.*; import org.lobobrowser.html.gui.HtmlPanel; import org.lobobrowser.html.parser.*; import…
lonesome
  • 2,503
  • 6
  • 35
  • 61
0
votes
1 answer

java - cannot assign value in invokeAndWait to global string variable

I am developing an application using the java-simple-serial-connector API to read and write to serial port. I am facing a problem when I try to read data bytes and assign them to a global String variable (sReader). sReader does not get the whole…
jadrijan
  • 1,438
  • 4
  • 31
  • 48
0
votes
0 answers

Can SwingUtilities.getLocationOnScreen() ignore windows scaling?

I want to call SwingUtilities.convertPointToScreen(clickPoint, component) but i want a result where the windows scaling is NOT taken into account. When the click occurs on the primary screen the point is correct, but if the click was made on the…
Ben Janus
  • 19
  • 4
0
votes
2 answers

Java Swing Wait message will not show up

I have a Java3D scenegraph update task which takes 3-4 seconds on my laptop to complete. During this time I want a window showing up, asking the user to wait until the job completes. I have a simelar situation which takes longer and my…
Alex
  • 1,387
  • 2
  • 9
  • 14
0
votes
1 answer

How to have 100% test coverage for function that calls invokeLater()?

I am using Junit4. This is my test class: import org.junit.Test; public class UIUtilTest { @Test public void testMultiline() { var multiLineText = "one\ntwo"; UIUtil.showError(multiLineText, "title"); assert true; …
0
votes
3 answers

How to dissapear rectangle like point in Packman

My game is similar to Packman. My problem is, that if Packman will eat the point, no one disappear respectively every point except the first one will change colour like background. I know a I have it in method, but It did what I want when I draw…
0
votes
2 answers

How can I make SwingUtilities.invokeLater execute tasks faster?

I use SwingUtilities.invokeLater to update the UI. Sometimes tasks are executed almost at as soon as invokeLater is called, but sometimes it takes few seconds for it, that I would like to avoid. Are there any settings that can help me with this? I…
Bobby
  • 534
  • 3
  • 7
  • 21
0
votes
1 answer

SwingUtilities3 class does not import to the project

I am trying to import SwingUtilities3 to the project. import com.sun.java.swing.SwingUtilities3; It give me this error message Description Resource Path Location Type Access restriction: The type 'SwingUtilities3' is not API (restriction…
ozan33.java
  • 33
  • 1
  • 7
0
votes
1 answer

Swingutilities.invokeLater and while loop

my prog uses a frame and a panel, which are created once in a loop. The frame gets created and displayed as normal, but for some reason the panel is not created and/or it is not displayed. any thoughts. cheers. class GUIThread extends Thread { …
0
votes
1 answer

How to append text to a JTextArea using data from a separate thread

I have a Scheduler class with a thread in charge of creating Process objects and I want to take the Process object as they are created and display the useful information to a JTextArea. However, when the Scheduler class creates the Process the…
1 2 3
8 9