Skip to content

Instantly share code, notes, and snippets.

package com.anemortalkid;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
/**
* Not completed, hey dude at least give this a try and finish it instead of asking people to do your homework plox
*/
public class EmptyRectangle {
private static String createXAxisWall(int width) {
String firstStar = "*";
String midDashes = "";
for (int i = 0; i < width - 2; i++) {
midDashes += "-";
public class StringReplaceStuff {
public static void main(String[] args) {
String testString = "Hello World!";
// replace o with 0, replaceAll takes a string pattern to replace
String osReplaced = testString.replaceAll("o", "0");
System.out.println("Without O = " + osReplaced);
// if we want to add to our replacement, we need to do it in different
public class Animal {
private String name;
public Animal(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
public class Steve {
String input;
String[] steve = { "you", "can", "start", "by" };
JFrame frame;
JTextField textField;
public Steve() {
frame = new JFrame();
textField = new JTextField();
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
public class WhileLoop {
public static void main(String[] args) {
// assume this is the data from the file
package com.anemortalid.essex.whatson.scrape;
import java.util.ArrayList;
import java.util.List;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
@AnEmortalKid
AnEmortalKid / ImageDisplayer
Created October 20, 2015 01:34
displays a scrubbed image on a panel
package com.anemortalid.essex.whatson.scrape;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;
a
public class Question {
private String question;
private String correctAnswer;
private String[] answerOptions;
public Question(String question, String correctAnswer, String[] answerOptions) {
this.question = question;
this.correctAnswer = correctAnswer;
this.answerOptions = answerOptions;