User Tools

Site Tools


third_qtr_labs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
third_qtr_labs [2020/01/09 15:51] cthielthird_qtr_labs [2023/01/19 20:27] (current) frchris
Line 1: Line 1:
-**Mr Potato Head** +  - [[Recursion Demos]] 
-[[https://mathorama.com/apcs/pmwiki.php?n=Main.MrPotatoHead]]+  [[https://mathorama.com/apcs/pmwiki.php?n=Main.Recursion | Old Recursion Demos]] 
 +  - [[Searching a ArrayList of String]] 
 +  - [[Searching|A Stopwatch for Searching]] 
 +  - [[Sorting]] 
 +  - [[https://mathorama.com/apcs/pmwiki.php?n=Main.SimonGame|Simon Game]] 
 +  - [[Celebrity Lab]] 
 +  - [[https://mathorama.com/apcs/pmwiki.php?n=Main.CarTalkLab|Car Talk]] 
 +  - [[https://mathorama.com/apcs/pmwiki.php?n=Main.Employee|Employee]] 
 +  - [[https://mathorama.com/wiki/doku.php?id=greed_game|Greed Game]] 
 + 
  
- +  - [[https://horstmann.com/codecheck/java-objects-early.html| CodeChecker]] from Horstman  
-{{https://mathorama.com/apcs/uploads/Main/potatoheadGrid.png}} +  - [[Mr Potato Head]] 
- +  - [[https://mathorama.com/apcs/pmwiki.php?n=Main.LizardSplat|Lizard Splat]]
- +
-<code> +
-import java.awt.Color; +
-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() +
-    { +
- +
-        //initialize variables here... +
-        titleFont new Font("Roman", Font.BOLD, 18); +
-        regularFont = new Font("Helvetica", Font.PLAIN, 12); +
- +
-    } +
- +
-    public static void main(String[args) { +
-        MyPotatoApplication app= new MyPotatoApplication(); +
-        JFrame window = new JFrame("My Potato Application"); +
-        window.setSize(WIDTH, HEIGHT); +
-        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, 0, getWidth(),getHeight()); +
-        g.setColor(Color.BLUE); +
-        g.setFont(titleFont); +
-        g.drawString("My Potato Application", 20, 20); +
-        g.setColor(Color.BLACK); +
-        g.setFont(regularFont); +
-        g.drawString("Version 1.0", 20, 40); +
-        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.1578603088.txt.gz · Last modified: 2020/01/09 15:51 by cthiel

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki