Created
February 10, 2022 18:12
-
-
Save argestes/548124864b543d23ed111993d20522d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import java.awt.*; | |
public class Demo { | |
public static void main(String[] args) { | |
// JLabel northLabel = new JLabel("North"); | |
JFrame application = new JFrame(); | |
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
// // add the labels to the frame; the second argument specifies | |
// // where on the frame to add the label | |
// application.add(northLabel, BorderLayout.NORTH); | |
// | |
// application.add(new Panel(), BorderLayout.CENTER); | |
// | |
JLabel label = new JLabel("Sevval"); | |
JLabel labelYigit = new JLabel("Yigit"); | |
application.add(label, BorderLayout.NORTH); | |
application.add(labelYigit, BorderLayout.CENTER); | |
application.add(new KendiPanelim(), BorderLayout.CENTER); | |
application.setSize(500, 500); // set the size of the frame | |
application.setVisible(true); | |
} | |
static class KendiPanelim extends JPanel { | |
@Override | |
protected void paintComponent(Graphics g) { | |
super.paintComponent(g); | |
g.setColor(Color.GREEN); | |
g.fillArc(10, 10, 100, 100, 0, 90); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment