how to create a Rectangle in java
Java
import javax.swing.JFrame;
import java.awt.Rectangle;
import javax.swing.JComponent;
import java.awt.Graphics2D;
import java.awt.Graphics;
import java.awt.Color;
public class ChrismasTree {
public static void main(String[] args) {
JFrame window = new JFrame();
window.setTitle("Christmas Tree");
window.setSize(800, 1000);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setVisible(true);
DrawingComponent DC = new DrawingComponent();
window.add(DC);
}
}
class DrawingComponent extends JComponent{
public void paint(Graphics graph0){
Graphics2D graph = (Graphics2D) graph0;
graph.setColor(Color.LIGHT_GRAY);
graph.draw(new Rectangle(0, 710, 70, 60));
graph.setColor(Color.BLUE);
graph.draw(new Rectangle(70, 600, 50, 100));
graph.setColor(Color.BLACK);
}
}
Also in Java:
- Title
- enum in java
- Category
- Java
- Title
- check if a char is a space java
- Category
- Java
- Title
- add element to stack java
- Category
- Java
- Title
- Write a JAVA method that expands a given binomial (ax + by)n, where integers a, b, n are user inputs. For example, if a = 2, b = -12, n = 4 are entered the method should print or return
- Category
- Java
- Title
- java get annotation value
- Category
- Java
- Title
- partial view tiles spring
- Category
- Java
- Title
- convert char to string java
- Category
- Java
- Title
- Create ArrayList from array java
- Category
- Java
- Title
- java 8 retrieve all list from object into single list and ignore duplicates
- Category
- Java
- Title
- java - get open ports
- Category
- Java
- Title
- java read from file
- Category
- Java
- Title
- casting java
- Category
- Java
- Title
- parallel sorting in java 8
- Category
- Java
- Title
- show menuitem when menu hovered javafx
- Category
- Java
- Title
- reading string after double in java
- Category
- Java
- Title
- how to test how many of one character is in a string java
- Category
- Java
- Title
- print values of bst java
- Category
- Java
- Title
- computeifabsent hashmap java
- Category
- Java
- Title
- if statement java
- Category
- Java
- Title
- socket in java
- Category
- Java
- Title
- int java
- Category
- Java
- Title
- java open file
- Category
- Java
- Title
- input java
- Category
- Java
- Title
- java hahmap
- Category
- Java
- Title
- java read integer from text file into array scanner
- Category
- Java
- Title
- expression régulière seulement un espace java
- Category
- Java
- Title
- arraylist to int array java
- Category
- Java
- Title
- java run project from command line
- Category
- Java
- Title
- change fab image programatically
- Category
- Java
- Title
- how to get the dimensions of a 2d array in java
- Category
- Java
- Title
- null pointer exception java
- Category
- Java
- Title
- biginteger in java
- Category
- Java
- Title
- how to fill a 2d array in java
- Category
- Java
- Title
- get host from request object java
- Category
- Java
- Title
- spigot chat color with symbol
- Category
- Java
- Title
- nth prime number java
- Category
- Java
- Title
- Unhandled exception: java.lang.InterruptedException
- Category
- Java
- Title
- create notification android
- Category
- Java
- Title
- java iterate through map
- Category
- Java
- Title
- java initialize float to zero
- Category
- Java
- Title
- java file exists
- Category
- Java
- Title
- how to create a hashmap in java
- Category
- Java
- Title
- int to binary java
- Category
- Java
- Title
- write an infinite loop java
- Category
- Java
- Title
- java enum
- Category
- Java
- Title
- java how to serialize a file into a local server
- Category
- Java
- Title
- how to create an abstract class in java
- Category
- Java
- Title
- difference between java and javascript
- Category
- Java
- Title
- sieve in java
- Category
- Java
- Title
- @fortawesome/free-solid-svg-icons
- Category
- Java
- Title
- how to init an array with objects in java
- Category
- Java
- Title
- esponente in java
- Category
- Java
- Title
- Please ensure that your JAVA_HOME points to a valid Java SDK. You are currently pointing to: /usr/lib/jvm/java-13-oracle
- Category
- Java
- Title
- sort array java
- Category
- Java
- Title
- copy array in java
- Category
- Java
- Title
- Don't use a line-beased input after a token-based input.
- Category
- Java
- Title
- bukkit java get max players
- Category
- Java
- Title
- toString convert to long
- Category
- Java
- Title
- string length in java
- Category
- Java
- Title
- spigot kill entity
- Category
- Java
- Title
- how to calculate exponential in java
- Category
- Java
- Title
- get last element of array java
- Category
- Java
- Title
- java string to integer
- Category
- Java
- Title
- print out value java
- Category
- Java
- Title
- java mysql springboot jpa stackoverflow
- Category
- Java
- Title
- linux command to see all the java version installed
- Category
- Java
- Title
- java int to hex fixed length
- Category
- Java
- Title
- for loop in java stack overflow
- Category
- Java
- Title
- java windowbuilder full screen
- Category
- Java
- Title
- how intent
- Category
- Java
- Title
- error attribute fabattached not found
- Category
- Java
- Title
- Java array multidimensional hashcode
- Category
- Java
- Title
- java list get first element
- Category
- Java
- Title
- string replace java
- Category
- Java
- Title
- exception handling and reprompting
- Category
- Java
- Title
- java program to find prime number between 1 and 100
- Category
- Java
- Title
- how to set frame colo in java
- Category
- Java
- Title
- java 8 string to localdate
- Category
- Java
- Title
- java file download
- Category
- Java
- Title
- bootstrap alert
- Category
- Java
- Title
- Could not resolve project :app
- Category
- Java
- Title
- java script removing first three indexes
- Category
- Java
- Title
- java get first char
- Category
- Java
- Title
- inheritance setter and getter in java
- Category
- Java
- Title
- validation list empty java
- Category
- Java
- Title
- java bubble sort short circuit
- Category
- Java
- Title
- how to change text size of textview with code in android studio
- Category
- Java
- Title
- method resolve file in java
- Category
- Java
- Title
- read csv java
- Category
- Java
- Title
- replaceall in java
- Category
- Java
- Title
- Java array nested equals
- Category
- Java
- Title
- set iteration java
- Category
- Java
- Title
- java output array lists to file
- Category
- Java
- Title
- find numbers in a string java
- Category
- Java
- Title
- java android development get element by id
- Category
- Java
- Title
- how to split a string in java
- Category
- Java
- Title
- hello world java
- Category
- Java
- Title
- java taking console input
- Category
- Java
- Title
- déclarer un tableau en java
- Category
- Java
- Title
- JavaFX onMouseEntered
- Category
- Java