Skip to content

Instantly share code, notes, and snippets.

View KatrinaHoffert's full-sized avatar

Katrina Mitchell KatrinaHoffert

View GitHub Profile
// This file is part of Glest (www.glest.org)
//
// Copyright (C) 2001-2008 Martiño Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
<div class="ad-container" title="">
<div class="ad" title="">
<a href="http://meta.skeptics.stackexchange.com/ads/ct/2586?url=http%3a%2f%2fskeptics.stackexchange.com%2f%3ftab%3dfeatured" rel="nofollow" target="_blank" title=""><img src="http://stack-exchange-dynamic-ads.herokuapp.com/bounty.png" alt="Current Skeptics Stack Exchange bounties" title="" width="220" height="250" style=""></a>
</div>
<div class="footer-container">
<div class="footer" style="top: 0px;">
6 votes · <a href="http://meta.skeptics.stackexchange.com/questions/2570#2586" title="click to comment on this ad" target="_blank">comment</a> · <a href="http://meta.skeptics.stackexchange.com/ads/display/2570" target="_blank">stats</a>
</div>
</div>
</div>
import java.util.Scanner;
class Calculator
{
private double firstNumber = 0;
private double secondNumber = 0;
private String operation = null;
private String expression = null;
public double stepByStep() throws NumberFormatException
@KatrinaHoffert
KatrinaHoffert / DisplayPromptExample.java
Last active December 25, 2015 03:38
A Java example of a prompt in the bottom right corner of the screen.
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;