# Making a program without a window border (and no background, just the shape)

**URL:** <https://discourse.processing.org/t/making-a-program-without-a-window-border-and-no-background-just-the-shape/41260>\
**Category:** Coding Questions\
**Created:** [March 13, 2023, 7:05am UTC](https://discourse.processing.org/t/making-a-program-without-a-window-border-and-no-background-just-the-shape/41260 "2023-03-13T07:05:30Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 15, 2023, 9:16pm UTC](https://discourse.processing.org/t/making-a-program-without-a-window-border-and-no-background-just-the-shape/41260/17 "2023-10-15T21:16:40Z")

</div>

> [@ctremblay](#):
>
> I want to create a program that looks like the character is actually on your screen. No background no boaders.

A simplified example using an image from a URL:

```auto
// Display an image without window border and transparent background
// Author: glv
// Date: 2023-10-15
// Insight gleaned from various sources; seek and you shall find.

import java.awt.*;
import javax.swing.*;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.net.URL;

JFrame frame;
ImageIcon img;
BufferedImage bimg;

void setup()
  {     
  surface.setVisible(false);  
  
  String url = "https://upload.wikimedia.org/wikipedia/commons/thumb/c/cb/Processing_2021_logo.svg/240px-Processing_2021_logo.svg.png";
  try
    {
    bimg = ImageIO.read(new URL(url));
    img = new ImageIcon(bimg); // BufferedImage from url
    }
  catch(IOException ex)
    {
    String imgPath = sketchPath() + "/data/test.png"; // Backup image
    img = new ImageIcon(imgPath);
    }
    
  frame = new JFrame();
  frame.setPreferredSize(new Dimension(img.getIconWidth(), img.getIconHeight()));  
    
  frame.add(new JLabel(img));
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setUndecorated(true);
  frame.setBackground(new Color(0, 0, 0, 0));
  frame.pack();
  frame.setVisible(true); 
  }

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/2/f/2f49d54405038bea9f7f93340711d5b59e8f3402.png)

You can create your own image and modify code as necessary.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/making-a-program-without-a-window-border-and-no-background-just-the-shape/41260)._
