1

http://image.ohozaa.com/view/6fcjh

enter image description here

How to do this with Java Source code

I can merge that but i can not to connect that like this pictue

Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
Puchong
  • 93
  • 2
  • 6

3 Answers3

1

Put each image in an ImageIcon, then each Icon in a JLabel, and then add both JLabels to a JPanel that uses GridLayout(2, 1) (2 rows, 1 column).

Sastrija
  • 3,284
  • 6
  • 47
  • 64
Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
1

Another approach would be to combine multiple Icons into a single Icon. See Compound Icon.

camickr
  • 321,443
  • 19
  • 166
  • 288
0
        File path = new File("images");

        BufferedImage image = ImageIO.read(new File(path, "1 (1).jpg"));
        BufferedImage overlay = ImageIO.read(new File(path, "1 (2).jpg"));

        int w = image.getWidth();
        int h = image.getHeight()+ overlay.getHeight();
        BufferedImage combined = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);

        Graphics g = combined.getGraphics();
        g.drawImage(image, 0, 0, null);
        g.drawImage(overlay, 0, image.getHeight(), null);

        ImageIO.write(combined, "PNG", new File(path, "combined 2.png"));