Skip to content
Advertisement

Tag: swing

Mirroring an Image in Java

Background info: I’ve made a program that uploads an image using JFileChooser and fills in the space of the JFrame. I then apply filters via buttons. Currently 3 of my 4 filters work, or all except my mirror one. It randomly (or I guess not so randomly as there’s always a reason, I just don’t know what I did) worked

How to save an image using JFileChooser

Background info: I’ve made a program that uploads an image using JFileChooser and have made fill in the space of the JFrame. My Question: I’ve attempted implementing my method on a save button and so far I can pull up the JFileChooser but it will not actually save the image. So how would I go about saving the same image

GridBagLayout 25% 50% 25%

Is this the right way to prevent GridBagLayout cells from being resized relative to their contents? SSCCE Answer Interesting. I’ve never seen an approach like this before. Typically the GridBagLayout is used such that: Each component is allocated space based on its preferred size If extra space is available then space is allocated to to each component based on the

Trouble spacing in JFrame

I am new to Java, what I am trying to do is generate a GUI with a bunch of images I have managed to generate a bunch of images, however, they have unnecessary space between them horizontally, is there any way that I can get rid of this currently I am generating them like so? is there some other method

JTable multiple selection on Mac OS X

I have a Swing application and we are having a problem with some Mac users and JTable components. The tables have this selection mode set: On Windows with this selected you can: select a single row select contiguous rows by holding the mouse and dragging select contiguous rows by clicking the first row to select, pressing shift and clicking the

How to change JFreeChart vertical bar to a solid color?

I have the following sample code for a JFreeChart, how to change the vertical bars to a solid color [ right now it has some white color in each bar ] ? Answer As shown here, use a StandardXYBarPainter to get a flat effect instead of the default gradient. I tried, but didn’t work: renderer2.setDefaultBarPainter(new StandardXYBarPainter()). Note that XYBarRenderer.setDefaultBarPainter() is

Advertisement