Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java change frame border

import java.awt.*;
import javax.swing.*;

public class BorderFrameExample extends JFrame 
{
   JLabel l = new JLabel("Welcome!", JLabel.CENTER);
   
   public BorderFrameExample() {
      //add label to frame
      add(l, BorderLayout.CENTER);
      //remove the decoration
      setUndecorated(true);
      //set border
      getRootPane().setBorder(
         BorderFactory.createMatteBorder(4, 4, 4, 4, Color.BLUE)
      );
      setSize(250,250);
      setVisible(true);
      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   }
   public static void main(String[] args) {
      new BorderFrameExample();
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java border 
Java :: java local method 
Java :: char value java 
Java :: java hashmap remove by condition 
Java :: . Java Program to Delete the Specified Integer from an Array 
Java :: android list tostring 
Java :: redshift establish connection jav gradle 
Java :: java set font 
Java :: java csv compare 
Java :: string java 
Java :: get width and height of screen libgdx 
Java :: Value Change Listener to JTextField 
Java :: The superclass "jakarta.servlet.http.HttpServlet" was not found on the Java Build Path 
Java :: final keyword in java 
Java :: map.keyset in java 
Java :: how to make a rest api in spring 
Java :: 2048 java code 
Java :: processing pi 
Java :: how to get filename without extension in java 
Java :: java int 0/0 
Java :: find first and last position of element in sorted array 
Java :: Java @Deprecated annotation 
Java :: java final modifier on method 
Java :: The Longest Substring 
Java :: compare 2 hashmap 
Java :: GridLayout 
Java :: one key with multiple values map java 
Java :: logcat android 
Java :: nested class in java 8 
Java :: Java Access LinkedList elements 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =