third_qtr_labs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| third_qtr_labs [2020/01/09 15:49] – cthiel | third_qtr_labs [2025/01/07 10:39] (current) – frchris | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | **Mr Potato Head** | + | - [[Sem 1 FRQs]] |
| - | [[https:// | + | - [[Recursion Demos]] |
| + | - [[https:// | ||
| + | - [[Searching a ArrayList of String]] | ||
| + | - [[Searching|A Stopwatch for Searching]] | ||
| + | - [[Sorting]] | ||
| + | - [[https:// | ||
| + | - [[Celebrity Lab]] | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | - [[https:// | ||
| + | |||
| - | + | - [[https://horstmann.com/codecheck/java-objects-early.html| CodeChecker]] from Horstman | |
| - | {{https://mathorama.com/apcs/uploads/ | + | - [[Mr Potato Head]] |
| - | {code} | + | - [[https:// |
| - | import | + | |
| - | import java.awt.Font; | + | |
| - | import java.awt.Graphics; | + | |
| - | import javax.swing.JFrame; | + | |
| - | import javax.swing.JPanel; | + | |
| - | + | ||
| - | public class MyPotatoApplication extends JPanel | + | |
| - | { | + | |
| - | public static int WIDTH=800; | + | |
| - | public static int HEIGHT=600; | + | |
| - | private Font titleFont, regularFont; | + | |
| - | + | ||
| - | public MyPotatoApplication() | + | |
| - | { | + | |
| - | + | ||
| - | | + | |
| - | titleFont | + | |
| - | regularFont = new Font(" | + | |
| - | + | ||
| - | } | + | |
| - | + | ||
| - | public static void main(String[] args) { | + | |
| - | MyPotatoApplication app= new MyPotatoApplication(); | + | |
| - | JFrame window = new JFrame(" | + | |
| - | window.setSize(WIDTH, | + | |
| - | window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | + | |
| - | window.getContentPane().add(app); | + | |
| - | window.setVisible(true); | + | |
| - | + | ||
| - | } | + | |
| - | + | ||
| - | public void paintComponent(Graphics g){ | + | |
| - | super.paintComponent(g); | + | |
| - | g.setColor(Color.WHITE); | + | |
| - | g.fillRect(0, | + | |
| - | g.setColor(Color.BLUE); | + | |
| - | g.setFont(titleFont); | + | |
| - | g.drawString(" | + | |
| - | g.setColor(Color.BLACK); | + | |
| - | g.setFont(regularFont); | + | |
| - | g.drawString(" | + | |
| - | Potato p = new MrPotatoHead(g); | + | |
| - | } | + | |
| - | // update is a workaround to cure Windows screen flicker problem | + | |
| - | public void update(Graphics g){ | + | |
| - | paint(g); | + | |
| - | } | + | |
| - | + | ||
| - | } | + | |
| - | {code} | + | |
third_qtr_labs.1578602956.txt.gz · Last modified: 2020/01/09 15:49 by cthiel