Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.net.URL;
- import java.net.URLConnection;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JButton;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.SwingConstants;
- import org.powerbot.concurrent.Task;
- import org.powerbot.concurrent.strategy.Condition;
- import org.powerbot.concurrent.strategy.Strategy;
- import org.powerbot.game.api.ActiveScript;
- import org.powerbot.game.api.Manifest;
- import org.powerbot.game.api.methods.Tabs;
- import org.powerbot.game.api.methods.Walking;
- import org.powerbot.game.api.methods.Widgets;
- import org.powerbot.game.api.methods.input.Mouse;
- import org.powerbot.game.api.methods.interactive.NPCs;
- import org.powerbot.game.api.methods.interactive.Players;
- import org.powerbot.game.api.methods.node.SceneEntities;
- import org.powerbot.game.api.methods.tab.Inventory;
- import org.powerbot.game.api.methods.widget.Camera;
- import org.powerbot.game.api.util.Random;
- import org.powerbot.game.api.util.Time;
- import org.powerbot.game.api.wrappers.Area;
- import org.powerbot.game.api.wrappers.Tile;
- import org.powerbot.game.api.wrappers.widget.WidgetChild;
- import org.powerbot.game.bot.event.listener.PaintListener;
- @Manifest(name = "Water Runner", description = "Fills Vials, Jugs, bowls etc. also softens clay", version = 1.0, authors = {"Thondar"})
- public class WaterRunner extends ActiveScript implements PaintListener {
- int Empty;
- int Full;
- int Clay = 434;
- int SoftClay = 1761;
- int Vial = 229;
- int VialWater = 227;
- int Bucket = 1925;
- int BucketWater = 1929;
- int Jug = 1935;
- int JugWater = 1937;
- int Bowl = 1923;
- int BowlWater = 1921;
- int ClayPrice, SoftClayPrice, VialPrice, VialWaterPrice, BucketPrice, BucketWaterPrice, JugPrice, JugWaterPrice, BowlPrice, BowlWaterPrice;
- int WaterPump = 11661;
- int FullCount;
- int FullInv;
- int Profit;
- int ProfitHour;
- int FullPrice;
- int EmptyPrice;
- int SleepTimer;
- int Claycheck;
- int Banker = 6200;
- long startTime;
- long runTime, xpTime;
- long hr, min, sec;
- long xpGain;
- private static WidgetChild ClayWidget;
- String time;
- String status;
- Area BankArea = new Area(new Tile(2943, 3367, 0), new Tile(2949, 3370, 0));
- Area WaterArea = new Area(new Tile(2946, 3381, 0), new Tile(2950, 3384, 0));
- Tile WaterTile = new Tile(2949, 3382, 0);
- Tile BankTile = new Tile(2946, 3368, 0);
- boolean start = true;
- private int getPrice(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + Clay);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice1(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + SoftClay);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice2(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + Vial);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice3(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + VialWater);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice4(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + Bucket);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice5(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + BucketWater);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice6(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + Jug);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice7(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + JugWater);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice8(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + Bowl);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- private int getPrice9(int id) throws IOException {
- URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + BowlWater);
- URLConnection con = url.openConnection();
- BufferedReader in = new BufferedReader(new InputStreamReader(
- con.getInputStream()));
- String line = "";
- String inputLine;
- while ((inputLine = in.readLine()) != null) {
- line += inputLine;
- }
- in.close();
- if (!line.contains("mark_price"))
- return -1;
- line = line.substring(line.indexOf("mark_price\":\"")
- + "mark_price\":\"".length());
- line = line.substring(0, line.indexOf("\""));
- return Integer.parseInt(line.replaceAll(",", ""));
- }
- GUI g;
- private boolean guiWait = true;
- @Override
- protected void setup() {
- startTime = System.currentTimeMillis();
- FullCount = 0;
- try {
- ClayPrice = getPrice(Clay);
- SoftClayPrice = getPrice1(SoftClay);
- VialPrice = getPrice2(Vial);
- VialWaterPrice = getPrice3(VialWater);
- BucketPrice = getPrice4(Bucket);
- BucketWaterPrice = getPrice5(BucketWater);
- JugPrice = getPrice6(Jug);
- JugWaterPrice = getPrice7(JugWater);
- BowlPrice = getPrice8(Bowl);
- BowlWaterPrice = getPrice9(BowlWater);
- } catch (IOException e) {
- e.printStackTrace();
- }
- g = new GUI();
- g.setVisible(true);
- final WaitGui guiTask = new WaitGui();
- provide(new Strategy(guiTask, guiTask));
- provide(new Strategy(new WaitGui(), new WaitGui()));
- BankOpen bankopen = new BankOpen();
- Strategy bankopenStrategy = new Strategy(bankopen, bankopen);
- provide(bankopenStrategy);
- Bank bank = new Bank();
- Strategy bankStrategy = new Strategy(bank, bank);
- provide(bankStrategy);
- Water water = new Water();
- Strategy waterStrategy = new Strategy(water, water);
- provide(waterStrategy);
- Clay clay = new Clay();
- Strategy clayStrategy = new Strategy(clay, clay);
- provide(clayStrategy);
- AntiBan ab = new AntiBan();
- Strategy abStrategy = new Strategy(ab, ab);
- provide(abStrategy);
- Tabs.INVENTORY.open(false);
- Walking.setRun(true);
- }
- private class WaitGui implements Task, Condition {
- @Override
- public void run() {
- while (guiWait) {
- Time.sleep(500);
- }
- }
- public boolean validate() {
- return guiWait;
- }
- }
- private class BankOpen implements Task, Condition {
- @Override
- public void run() {
- if(!BankArea.contains(Players.getLocal())){
- status = ("Running to Bank");
- Walking.walk(BankTile);
- Time.sleep(Random.nextInt(500, 700));
- }
- if(BankArea.contains(Players.getLocal())){
- status = ("Banking");
- NPCs.getNearest(Banker).interact("Bank");
- Time.sleep(Random.nextInt(900, 1200));
- }
- }
- @Override
- public boolean validate() {
- return (Inventory.getCount(Empty) == 0) && !org.powerbot.game.api.methods.widget.Bank.isOpen();
- }
- }
- private class Bank implements Task, Condition {
- @Override
- public void run() {
- status = ("Banking");
- FullInv = Inventory.getCount(Full);
- FullCount += FullInv;
- org.powerbot.game.api.methods.widget.Bank.depositInventory();
- Time.sleep(Random.nextInt(300, 500));
- org.powerbot.game.api.methods.widget.Bank.withdraw(Empty, 28);
- Time.sleep(Random.nextInt(300, 500));
- org.powerbot.game.api.methods.widget.Bank.close();
- }
- @Override
- public boolean validate() {
- return Inventory.getCount(Empty) < 1 && org.powerbot.game.api.methods.widget.Bank.isOpen() && BankArea.contains(Players.getLocal());
- }
- }
- private class Water implements Task, Condition {
- @Override
- public void run() {
- ClayWidget = Widgets.get(905, 14);
- if(!WaterArea.contains(Players.getLocal())){
- status = ("Running to Water");
- Walking.setRun(true);
- Walking.walk(WaterTile);
- }
- if(WaterArea.contains(Players.getLocal())){
- status = ("Using Water");
- Inventory.getItem(Empty).getWidgetChild().interact("Use");
- Camera.turnTo(SceneEntities.getNearest(WaterPump).getLocation());
- Time.sleep(Random.nextInt(300, 500));
- SceneEntities.getNearest(WaterPump).interact("Use", "Waterpump");
- Time.sleep(Random.nextInt(300, 500));
- Time.sleep(SleepTimer);
- }
- }
- @Override
- public boolean validate() {
- return (Inventory.getCount(Empty) > 0) && (Players.getLocal().getAnimation() == -1) && Claycheck == 1;
- }
- }
- private class Clay implements Task, Condition {
- @Override
- public void run() {
- ClayWidget = Widgets.get(905, 14);
- if(!WaterArea.contains(Players.getLocal())){
- status = ("Running to Water");
- Walking.walk(WaterTile);
- }
- if(WaterArea.contains(Players.getLocal())){
- status = ("Using Water");
- Inventory.getItem(Empty).getWidgetChild().interact("Use");
- Camera.turnTo(SceneEntities.getNearest(WaterPump).getLocation());
- Time.sleep(Random.nextInt(300, 500));
- SceneEntities.getNearest(WaterPump).interact("Use", "Waterpump");
- Time.sleep(Random.nextInt(1100, 1500));
- ClayWidget.click(true);
- Time.sleep(SleepTimer);
- }
- }
- @Override
- public boolean validate() {
- return (Inventory.getCount(Empty) > 0) && (Players.getLocal().getAnimation() == -1) && Claycheck == 2;
- }
- }
- private class AntiBan implements Task, Condition {
- @Override
- public void run() {
- switch(Random.nextInt(1, 100)){
- case 3:
- Camera.setAngle(Random.nextInt(1, 150));
- case 33:
- Camera.setAngle(Random.nextInt(1, 310));
- case 75:
- Camera.setAngle(Random.nextInt(1, 210));
- default:
- }
- Time.sleep(Random.nextInt(500, 1000));
- }
- @Override
- public boolean validate() {
- return start;
- }
- }
- private AlphaComposite makeComposite(float alpha) {
- int type = AlphaComposite.SRC_OVER;
- return(AlphaComposite.getInstance(type, alpha));
- }
- private final Font font1 = new Font("Verdana", 0, 16);
- private final Font font5 = new Font("Verdana", 1, 16);
- private final Font font2 = new Font("Verdana", 0, 12);
- private final Font font3 = new Font("Verdana", 0, 13);
- private final Font font4 = new Font("Verdana", 0, 9);
- @Override
- public void onRepaint(Graphics g) {
- Graphics2D g2d = (Graphics2D) g;
- g2d.setColor(Color.CYAN);
- g2d.drawLine((Mouse.getX() -3), Mouse.getY(), (Mouse.getX() +3), Mouse.getY());
- g2d.drawLine(Mouse.getX(), (Mouse.getY() - 3), Mouse.getX(), (Mouse.getY() + 3));
- g2d.drawLine((Mouse.getX() - 1), (Mouse.getY() - 1), (Mouse.getX() + 1), (Mouse.getY() + 1));
- g2d.drawLine((Mouse.getX() + 1), (Mouse.getY() - 1), (Mouse.getX() - 1), (Mouse.getY() + 1));
- int FullHour = (int) ((FullCount) * 3600000D / (System
- .currentTimeMillis() - startTime));
- int FullPrice1 = FullPrice - EmptyPrice;
- Profit = FullCount * FullPrice1;
- ProfitHour = FullHour * FullPrice1;
- Rectangle bg = new Rectangle(0, 0, 800, 50);
- g2d.setComposite(makeComposite(1f));
- g2d.setColor(Color.BLACK);
- g2d.fill(bg);
- g2d.setFont(font1);
- g2d.setComposite(makeComposite(1f));
- g2d.setColor(Color.BLUE);
- g2d.drawString("Water Runner", 15, 20);
- g2d.setFont(font3);
- g2d.drawString("by Thondar", 27, 35);
- g2d.setFont(font4);
- g2d.drawString("Version 1.0", 33, 45);
- g2d.setFont(font2);
- g2d.setComposite(makeComposite(.8f));
- g2d.setColor(Color.CYAN);
- g2d.drawString("Time Run: " + timeRun(), 150, 20);
- g2d.setComposite(makeComposite(.8f));
- g2d.setColor(Color.CYAN);
- g2d.drawString("Status: " + status, 150, 40);
- g2d.setComposite(makeComposite(.8f));
- g2d.setColor(Color.CYAN);
- g2d.drawString("Items Banked: " + FullCount, 350, 20);
- g2d.setComposite(makeComposite(.8f));
- g2d.setColor(Color.CYAN);
- g2d.drawString("Items Banked/H: " + FullHour, 350, 40);
- g2d.setComposite(makeComposite(.8f));
- g2d.setColor(Color.CYAN);
- g2d.drawString("Profit: " + Profit, 550, 20);
- g2d.setComposite(makeComposite(.8f));
- g2d.setColor(Color.CYAN);
- g2d.drawString("Profit/H: " + ProfitHour, 550, 40);
- if(Empty == Clay){
- g2d.setFont(font5);
- g2d.setColor(Color.BLUE);
- g2d.drawString("Clay", 690, 33);
- }
- if(Empty == Vial){
- g2d.setFont(font5);
- g2d.setColor(Color.BLUE);
- g2d.drawString("Vials", 690, 33);
- }
- if(Empty == Jug){
- g2d.setFont(font5);
- g2d.setColor(Color.BLUE);
- g2d.drawString("Jugs", 690, 33);
- }
- if(Empty == Bucket){
- g2d.setFont(font5);
- g2d.setColor(Color.BLUE);
- g2d.drawString("Buckets", 675, 33);
- }
- if(Empty == Bowl){
- g2d.setFont(font5);
- g2d.setColor(Color.BLUE);
- g2d.drawString("Bowls", 690, 33);
- }
- }
- public String timeRun() {
- runTime = System.currentTimeMillis() - startTime;
- time = "";
- hr = runTime / (1000 * 60 * 60);
- min = (runTime % (1000 * 60 * 60)) / (1000 * 60);
- sec = ((runTime % (1000 * 60 * 60)) % (1000 * 60)) / 1000;
- if (hr < 10)
- time += "0" + hr + ":";
- else
- time += hr + ":";
- if (min < 10)
- time += "0" + min + ":";
- else
- time += min + ":";
- if (sec < 10)
- time += "0" + sec;
- else
- time += sec;
- return time;
- }
- class GUI extends JFrame {
- public GUI() {
- initComponents();
- }
- int ClayGUI = (SoftClayPrice - ClayPrice) * 1200;
- int VialGUI = (VialWaterPrice - VialPrice) * 2200;
- int BucketGUI = (BucketWaterPrice - BucketPrice) * 2200;
- int JugGUI = (JugWaterPrice - JugPrice) * 2200;
- int BowlGUI = (BowlWaterPrice - BowlPrice) * 2200;
- private void StartButtonActionPerformed(ActionEvent e) {
- String u = comboBox1.getSelectedItem().toString(); {
- if (u.equals("Soft Clay")) {
- Full = SoftClay;
- Empty = Clay;
- FullPrice = SoftClayPrice;
- EmptyPrice = ClayPrice;
- SleepTimer = 34500;
- Claycheck = 2;
- }else if (u.equals("Vial of Water")) {
- Full = VialWater;
- Empty = Vial;
- FullPrice = VialWaterPrice;
- EmptyPrice = VialPrice;
- SleepTimer = 17000;
- Claycheck = 1;
- }else if (u.equals("Bucket of Water")) {
- Full = BucketWater;
- Empty = Bucket;
- FullPrice = BucketWaterPrice;
- EmptyPrice = BucketPrice;
- SleepTimer = 17000;
- Claycheck = 1;
- }else if (u.equals("Jug of Water")) {
- Full = JugWater;
- Empty = Jug;
- FullPrice = JugWaterPrice;
- EmptyPrice = JugPrice;
- SleepTimer = 17000;
- Claycheck = 1;
- }else if (u.equals("Bowl of Water")) {
- Full = BowlWater;
- Empty = Bowl;
- FullPrice = BowlWaterPrice;
- EmptyPrice = BowlPrice;
- SleepTimer = 17000;
- Claycheck = 1;
- }
- }
- guiWait = false;
- g.dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - Jonas Bill Jensen
- label1 = new JLabel();
- StartButton = new JButton();
- comboBox1 = new JComboBox();
- label2 = new JLabel();
- label8 = new JLabel();
- label9 = new JLabel();
- label10 = new JLabel();
- label11 = new JLabel();
- label12 = new JLabel();
- label13 = new JLabel();
- //======== this ========
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- //---- label1 ----
- label1.setText("Water Runner");
- label1.setHorizontalAlignment(SwingConstants.CENTER);
- label1.setFont(new Font("Segoe Print", Font.BOLD, 26));
- contentPane.add(label1);
- label1.setBounds(0, 0, 375, 50);
- //---- StartButton ----
- StartButton.setText("Start");
- StartButton.setFont(new Font("Verdana", Font.PLAIN, 12));
- StartButton.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- StartButtonActionPerformed(e);
- }
- });
- contentPane.add(StartButton);
- StartButton.setBounds(5, 270, 365, 60);
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Soft Clay",
- "Vial of Water",
- "Bucket of Water",
- "Jug of Water",
- "Bowl of Water"
- }));
- contentPane.add(comboBox1);
- comboBox1.setBounds(115, 95, 145, 30);
- //---- label2 ----
- label2.setText("What to run?");
- label2.setHorizontalAlignment(SwingConstants.CENTER);
- label2.setFont(new Font("Verdana", Font.PLAIN, 12));
- contentPane.add(label2);
- label2.setBounds(0, 70, 375, 30);
- //---- label8 ----
- label8.setText("Currently you will get:");
- label8.setHorizontalAlignment(SwingConstants.CENTER);
- label8.setFont(new Font("Verdana", Font.ITALIC, 12));
- contentPane.add(label8);
- label8.setBounds(0, 150, 375, label8.getPreferredSize().height);
- //---- label9 ----
- label9.setText(ClayGUI + " Gold per hour from Soft Clay");
- label9.setHorizontalAlignment(SwingConstants.CENTER);
- label9.setFont(label9.getFont().deriveFont(label9.getFont().getStyle() | Font.ITALIC));
- contentPane.add(label9);
- label9.setBounds(0, 175, 375, label9.getPreferredSize().height);
- //---- label10 ----
- label10.setText(VialGUI + " Gold per hour from Vials of Water");
- label10.setHorizontalAlignment(SwingConstants.CENTER);
- label10.setFont(label10.getFont().deriveFont(label10.getFont().getStyle() | Font.ITALIC));
- contentPane.add(label10);
- label10.setBounds(0, 190, 375, 14);
- //---- label11 ----
- label11.setText(BucketGUI + " Gold per hour from Bucket of Water");
- label11.setHorizontalAlignment(SwingConstants.CENTER);
- label11.setFont(label11.getFont().deriveFont(label11.getFont().getStyle() | Font.ITALIC));
- contentPane.add(label11);
- label11.setBounds(0, 205, 375, label11.getPreferredSize().height);
- //---- label12 ----
- label12.setText(JugGUI + " Gold per hour from Jug of Water");
- label12.setHorizontalAlignment(SwingConstants.CENTER);
- label12.setFont(label12.getFont().deriveFont(label12.getFont().getStyle() | Font.ITALIC));
- contentPane.add(label12);
- label12.setBounds(0, 220, 375, label12.getPreferredSize().height);
- //---- label13 ----
- label13.setText(BowlGUI + " Gold per hour from Bowl of Water");
- label13.setHorizontalAlignment(SwingConstants.CENTER);
- label13.setFont(label13.getFont().deriveFont(label13.getFont().getStyle() | Font.ITALIC));
- contentPane.add(label13);
- label13.setBounds(0, 235, 375, label13.getPreferredSize().height);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - Jonas Bill Jensen
- private JLabel label1;
- private JButton StartButton;
- private JComboBox comboBox1;
- private JLabel label2;
- private JLabel label8;
- private JLabel label9;
- private JLabel label10;
- private JLabel label11;
- private JLabel label12;
- private JLabel label13;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment