Commit e0c9d8b5 authored by Junita Sinambela's avatar Junita Sinambela
Browse files

Merge branch 'master' of...

Merge branch 'master' of http://gitlab.informatika.org/sinambelajunita/IF3230-Tugas-Besar-Sister-2015
parents a24f5b9d 0c8c324f
......@@ -35,7 +35,8 @@ includes=**
jar.compress=false
javac.classpath=\
${file.reference.org.json-20120521.jar}:\
${file.reference.json-simple-1.1.1.jar}
${file.reference.json-simple-1.1.1.jar}:\
${libs.absolutelayout.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
......
......@@ -19,6 +19,20 @@ public class InventoryPanel extends javax.swing.JPanel {
*/
public InventoryPanel() {
initComponents();
initItem();
}
public void initItem(){
HoneyCount.setText(GrandQuest.inventory.get(0).toString());
HerbsCount.setText(GrandQuest.inventory.get(1).toString());
ClayCount.setText(GrandQuest.inventory.get(2).toString());
MineralCount.setText(GrandQuest.inventory.get(3).toString());
PotionCount.setText(GrandQuest.inventory.get(4).toString());
IncenseCount.setText(GrandQuest.inventory.get(5).toString());
GemsCount.setText(GrandQuest.inventory.get(6).toString());
LifeElixirCount.setText(GrandQuest.inventory.get(7).toString());
ManaCrystalCount.setText(GrandQuest.inventory.get(8).toString());
PilospherCount.setText(GrandQuest.inventory.get(9).toString());
}
/**
......
......@@ -23,10 +23,12 @@ public class LoginPanel extends javax.swing.JPanel {
public LoginPanel() {
// GrandQuest.host = "192.168.43.249";
// GrandQuest.port = 6789;
// GrandQuest.host = "localhost";
// GrandQuest.port = 8080;
GrandQuest.host = "167.205.32.46";
GrandQuest.port = 8025;
GrandQuest.host = "localhost";
GrandQuest.port = 8080;
// GrandQuest.host = "167.205.32.46";
// GrandQuest.port = 8026;
// GrandQuest.host = "167.205.88.51";
// GrandQuest.port = 6789;
gq = new GrandQuest();
initComponents();
}
......
......@@ -19,6 +19,7 @@ import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.TimeZone;
import javax.swing.ImageIcon;
......@@ -33,6 +34,8 @@ import javax.swing.table.DefaultTableCellRenderer;
*/
public class MapPanel extends javax.swing.JPanel {
GrandQuest gq = new GrandQuest();
Timer t;
static int nHeight;
static int nWidth;
static long counter;
......@@ -51,6 +54,10 @@ public class MapPanel extends javax.swing.JPanel {
countStatus = 0;
posX = Integer.valueOf(Request.findInResponses("x"));
posY = Integer.valueOf(Request.findInResponses("y"));
desiredX = posX;
desiredY = posY;
counter = System.currentTimeMillis();
moveTime = Long.valueOf(Request.findInResponses("time"))*1000;
......@@ -204,7 +211,7 @@ public class MapPanel extends javax.swing.JPanel {
}
};
Timer t = new Timer(1000,time);
t = new Timer(1000,time);
t.start();
}
......@@ -415,14 +422,71 @@ public class MapPanel extends javax.swing.JPanel {
}// </editor-fold>//GEN-END:initComponents
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
gq.retMixItemPanel();
if(Request.connectToServer(GrandQuest.host,GrandQuest.port)){
String sentence = Request.inventory(GrandQuest.token).toString();
Request.responseHandler(Request.send(sentence));
}
if (Request.serverResponse!=null){
String res = Request.findInResponses("status");
switch(res){
case "ok" :
String inventory = Request.findInResponses("inventory");
String [] result = inventory.replaceAll("\\[", "").replaceAll("\\]", "").split(",");
GrandQuest.inventory = new ArrayList<>();
for(String number : result)
{
GrandQuest.inventory.add(Integer.parseInt(number));
}
break;
case "fail" :
JOptionPane.showMessageDialog(null, "Move Failed! \n"+Request.findInResponses("description"), "Information", JOptionPane.ERROR_MESSAGE);
break;
default :
JOptionPane.showMessageDialog(null, "Error!", "Error", JOptionPane.ERROR_MESSAGE);
break;
}
GrandQuest.savedPane = this;
gq.retMixItemPanel();
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
gq.retOfferingPanel();
if(Request.connectToServer(GrandQuest.host,GrandQuest.port)){
String sentence = Request.inventory(GrandQuest.token).toString();
Request.responseHandler(Request.send(sentence));
}
if (Request.serverResponse!=null){
String res = Request.findInResponses("status");
switch(res){
case "ok" :
String inventory = Request.findInResponses("inventory");
System.out.println(inventory);
String [] result = inventory.replaceAll("\\[", "").replaceAll("\\]", "").split(",");
GrandQuest.inventory = new ArrayList<>();
for(String number : result)
{
GrandQuest.inventory.add(Integer.parseInt(number));
}
break;
default :
JOptionPane.showMessageDialog(null, "Error!", "Error", JOptionPane.ERROR_MESSAGE);
break;
}
GrandQuest.savedPane = this;
gq.retOfferingPanel();
}
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
GrandQuest.savedPane = this;
gq.retTrade();
}//GEN-LAST:event_jButton3ActionPerformed
......@@ -436,11 +500,16 @@ public class MapPanel extends javax.swing.JPanel {
String res = Request.findInResponses("status");
switch(res){
case "ok" :
GrandQuest.inventory = Request.findInResponses("inventory");
System.out.println(GrandQuest.inventory);
break;
case "fail" :
JOptionPane.showMessageDialog(null, "Move Failed! \n"+Request.findInResponses("description"), "Information", JOptionPane.ERROR_MESSAGE);
String inventory = Request.findInResponses("inventory");
System.out.println(inventory);
String [] result = inventory.replaceAll("\\[", "").replaceAll("\\]", "").split(",");
GrandQuest.inventory = new ArrayList<>();
for(String number : result)
{
GrandQuest.inventory.add(Integer.parseInt(number));
}
break;
default :
JOptionPane.showMessageDialog(null, "Error!", "Error", JOptionPane.ERROR_MESSAGE);
......@@ -457,7 +526,11 @@ public class MapPanel extends javax.swing.JPanel {
}//GEN-LAST:event_jButton5ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
gq.retLogIn();
int ret = JOptionPane.showConfirmDialog(null, "Are you sure want to quit to the main menu?","Confirmation",JOptionPane.YES_NO_OPTION);
if (ret==0){
t.stop();
gq.retLogIn();
}
}//GEN-LAST:event_jButton6ActionPerformed
......
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
</AuxValues>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="49" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="69" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="23" max="-2" attributes="0"/>
<Component id="MixedItem" min="-2" pref="200" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
<Component id="jLabel1" max="32767" attributes="0"/>
<Component id="ItemName" min="-2" pref="246" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="66" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="MixedItem" min="-2" pref="120" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="37" max="-2" attributes="0"/>
<Component id="ItemName" min="-2" pref="28" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="24" style="3"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="66" green="33" red="0" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="CONGRATULATIONS"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="text" type="java.lang.String" value="You&apos;ve got new Item!"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="MixedItem">
<Properties>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Mixed Item"/>
<Property name="horizontalTextPosition" type="int" value="0"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="ItemName">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="3"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="Item Name"/>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="9"/>
</AuxValues>
</Component>
</SubComponents>
</Form>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package GUI;
/**
*
* @author Rikysamuel
*/
public class MixedItem extends javax.swing.JPanel {
/**
* Creates new form MixedItem
*/
public MixedItem() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
MixedItem = new javax.swing.JLabel();
ItemName = new javax.swing.JLabel();
jLabel1.setFont(new java.awt.Font("Tahoma", 3, 24)); // NOI18N
jLabel1.setForeground(new java.awt.Color(0, 51, 102));
jLabel1.setText("CONGRATULATIONS");
jLabel2.setText("You've got new Item!");
MixedItem.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
MixedItem.setText("Mixed Item");
MixedItem.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
ItemName.setFont(new java.awt.Font("Tahoma", 3, 12)); // NOI18N
ItemName.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
ItemName.setText("Item Name");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(49, 49, 49)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(69, 69, 69)
.addComponent(jLabel2))
.addGroup(layout.createSequentialGroup()
.addGap(23, 23, 23)
.addComponent(MixedItem, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(ItemName, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(66, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(MixedItem, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(37, 37, 37)
.addComponent(ItemName, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
public static javax.swing.JLabel ItemName;
public static javax.swing.JLabel MixedItem;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
// End of variables declaration//GEN-END:variables
}
......@@ -234,6 +234,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/honey.png"/>
</Property>
<Property name="name" type="java.lang.String" value="0" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="HoneyActionPerformed"/>
......@@ -244,6 +245,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/herbs.png"/>
</Property>
<Property name="name" type="java.lang.String" value="1" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="HerbsActionPerformed"/>
......@@ -254,6 +256,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/clay.png"/>
</Property>
<Property name="name" type="java.lang.String" value="2" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ClayActionPerformed"/>
......@@ -264,6 +267,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/mineral.png"/>
</Property>
<Property name="name" type="java.lang.String" value="3" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="MineralActionPerformed"/>
......@@ -274,6 +278,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/potion.png"/>
</Property>
<Property name="name" type="java.lang.String" value="4" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="PotionActionPerformed"/>
......@@ -284,6 +289,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/incense.png"/>
</Property>
<Property name="name" type="java.lang.String" value="5" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="IncenseActionPerformed"/>
......@@ -294,6 +300,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/gems.png"/>
</Property>
<Property name="name" type="java.lang.String" value="6" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="GemsActionPerformed"/>
......@@ -304,6 +311,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/life.png"/>
</Property>
<Property name="name" type="java.lang.String" value="7" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="LifeElixirActionPerformed"/>
......@@ -314,6 +322,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/mana.png"/>
</Property>
<Property name="name" type="java.lang.String" value="8" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ManaCrystalActionPerformed"/>
......@@ -324,6 +333,7 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/img/stone.png"/>
</Property>
<Property name="name" type="java.lang.String" value="9" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="PilosopherStoneActionPerformed"/>
......@@ -439,6 +449,7 @@
</Border>
</Property>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="name" type="java.lang.String" value="offered" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="SecondItem">
......@@ -451,6 +462,7 @@
</Border>
</Property>
<Property name="horizontalTextPosition" type="int" value="0"/>
<Property name="name" type="java.lang.String" value="demanded" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel11">
......@@ -477,6 +489,9 @@
<Properties>
<Property name="text" type="java.lang.String" value="Offer"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton2">
<Properties>
......
......@@ -6,7 +6,9 @@
package GUI;
import Request.Request;
import grandquest.GrandQuest;
import java.util.ArrayList;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
......@@ -25,6 +27,20 @@ public class OfferingPanel extends javax.swing.JPanel {
public OfferingPanel() {
gq = new GrandQuest();
initComponents();
initItem();
}
public void initItem(){
HoneyCount.setText(GrandQuest.inventory.get(0).toString());
HerbsCount.setText(GrandQuest.inventory.get(1).toString());
ClayCount.setText(GrandQuest.inventory.get(2).toString());
MineralCount.setText(GrandQuest.inventory.get(3).toString());
PotionCount.setText(GrandQuest.inventory.get(4).toString());
IncenseCount.setText(GrandQuest.inventory.get(5).toString());
GemsCount.setText(GrandQuest.inventory.get(6).toString());
LifeElixirCount.setText(GrandQuest.inventory.get(7).toString());
ManaCrystalCount.setText(GrandQuest.inventory.get(8).toString());
PilospherCount.setText(GrandQuest.inventory.get(9).toString());
}
/**
......@@ -79,6 +95,7 @@ public class OfferingPanel extends javax.swing.JPanel {
setPreferredSize(new java.awt.Dimension(720, 460));
Honey.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/honey.png"))); // NOI18N
Honey.setName("0"); // NOI18N
Honey.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
HoneyActionPerformed(evt);
......@@ -86,6 +103,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
Herbs.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/herbs.png"))); // NOI18N
Herbs.setName("1"); // NOI18N
Herbs.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
HerbsActionPerformed(evt);
......@@ -93,6 +111,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
Clay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/clay.png"))); // NOI18N
Clay.setName("2"); // NOI18N
Clay.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ClayActionPerformed(evt);
......@@ -100,6 +119,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
Mineral.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/mineral.png"))); // NOI18N
Mineral.setName("3"); // NOI18N
Mineral.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
MineralActionPerformed(evt);
......@@ -107,6 +127,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
Potion.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/potion.png"))); // NOI18N
Potion.setName("4"); // NOI18N
Potion.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PotionActionPerformed(evt);
......@@ -114,6 +135,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
Incense.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/incense.png"))); // NOI18N
Incense.setName("5"); // NOI18N
Incense.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
IncenseActionPerformed(evt);
......@@ -121,6 +143,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
Gems.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/gems.png"))); // NOI18N
Gems.setName("6"); // NOI18N
Gems.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
GemsActionPerformed(evt);
......@@ -128,6 +151,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
LifeElixir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/life.png"))); // NOI18N
LifeElixir.setName("7"); // NOI18N
LifeElixir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
LifeElixirActionPerformed(evt);
......@@ -135,6 +159,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
ManaCrystal.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/mana.png"))); // NOI18N
ManaCrystal.setName("8"); // NOI18N
ManaCrystal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ManaCrystalActionPerformed(evt);
......@@ -142,6 +167,7 @@ public class OfferingPanel extends javax.swing.JPanel {
});
PilosopherStone.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/stone.png"))); // NOI18N
PilosopherStone.setName("9"); // NOI18N
PilosopherStone.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
PilosopherStoneActionPerformed(evt);
......@@ -192,11 +218,13 @@ public class OfferingPanel extends javax.swing.JPanel {
FirstItem.setText("Offered Item");
FirstItem.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
FirstItem.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
FirstItem.setName("offered"); // NOI18N