Skip to content

Tag: java

JFrame Image, paint on top of it

I create a frame with an image with this code: That works fine, but now I want to paint something in that opened frame (on top of the image). I’m quite new in Java, and I’ve allready tried to make a class that extends JFrame, with a paint(Graphics g) method in it, but it wouldn’t work, I onl…

JLabel HTML4 support

My question is if JLabel (java swing) supports html4 and css2. I know, it supports html3.2 but I want newer version. Or is there another way to display html4 on a jPanel. Answer In short: no; HTML 3 only, before CSS. The “HTML” supported by JLabel, JButton, etc, is things like <font color=&#822…

JavaFX 2.1 TableView refresh items

I have this common issue, as it appears to be. My table view wont refresh my items after I reset them. I have checked the data and it’s the new one. I tried multiple solution from internet but no success. Can’t reset all the columns because it adds one empty one extra (dont know why) and the resiz…

Change priorityQueue to max priorityqueue

I have priority queue in Java of Integers: When I call pq.poll() I get the minimum element. Question: how to change the code to get the maximum element? Answer How about like this: The Collections.reverseOrder() provides a Comparator that would sort the elements in the PriorityQueue in a the oposite order to …