Profit Calculator 2.0 menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Confucius's Avatar Panda of Worlds The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1389
    Join Date
    Oct 2007
    Posts
    2,590
    Thanks G/R
    267/283
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Profit Calculator 2.0

    Hello everyone, first off I didn't know what section to put this in, so I thought here in the program section would be best!

    This tool is a profit calculator I coded in Java to help me learn (with a lot of help from sychotix). So it should be usable on linux, mac, windows, w/e as long as you have java installed.

    What it does, is you enter the name of the mat for a recipe, the price, and amount required, do this until you have all mats accounted for. Then you enter the sale price for it and whether or not you are selling it through the auction house. Then you hit Calculate and it will tell you the total profit you will make or lose.

    It has been updated to work with gold and silver, All whole numbers are gold, then tenths and hundredths are silver, the next two digits are copper and anything after is fractions of copper. For Example 1.7011 is equal to 1 gold 70 silver and 11 copper.

    If anything is bad with it please tell me.

    Here is source code (I used default java desktop application to make this so code is really long, but you can see there are no virus's in it).

    [spoiler]
    Code:
    /*
     * ProfitCalculatorView.java
     */
    
    package profitcalculator;
    
    import org.jdesktop.application.Action;
    import org.jdesktop.application.ResourceMap;
    import org.jdesktop.application.SingleFrameApplication;
    import org.jdesktop.application.FrameView;
    import org.jdesktop.application.TaskMonitor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import javax.swing.Timer;
    import javax.swing.Icon;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    
    /**
     * The application's main frame.
     */
    public class ProfitCalculatorView extends FrameView {
    
        public ProfitCalculatorView(SingleFrameApplication app) {
            super(app);
    
            initComponents();
    
            // status bar initialization - message timeout, idle icon and busy animation, etc
            ResourceMap resourceMap = getResourceMap();
            int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
            messageTimer = new Timer(messageTimeout, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                 
                }
            });
            messageTimer.setRepeats(false);
            int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
            for (int i = 0; i < busyIcons.length; i++) {
                busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
            }
            busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
         
                }
            });
            idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        
    
            // connecting action tasks to status bar via TaskMonitor
            TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
            taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
                public void propertyChange(java.beans.PropertyChangeEvent evt) {
                    String propertyName = evt.getPropertyName();
                    if ("started".equals(propertyName)) {
                        if (!busyIconTimer.isRunning()) {
                 
                            busyIconIndex = 0;
                            busyIconTimer.start();
                        }
                   ;
                    } else if ("done".equals(propertyName)) {
                        busyIconTimer.stop();
                  
                    } else if ("message".equals(propertyName)) {
                        String text = (String)(evt.getNewValue());
       
                        messageTimer.restart();
                    } else if ("progress".equals(propertyName)) {
                        int value = (Integer)(evt.getNewValue());
                   
                    }
                }
            });
        }
    
        @Action
      
    
        /** 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">                          
        private void initComponents() {
    
            mainPanel = new javax.swing.JPanel();
            jLabel1 = new javax.swing.JLabel();
            jTextField1 = new javax.swing.JTextField();
            jTextField2 = new javax.swing.JTextField();
            jTextField3 = new javax.swing.JTextField();
            jTextField4 = new javax.swing.JTextField();
            jTextField5 = new javax.swing.JTextField();
            jTextField6 = new javax.swing.JTextField();
            jTextField7 = new javax.swing.JTextField();
            jTextField8 = new javax.swing.JTextField();
            jTextField9 = new javax.swing.JTextField();
            jTextField10 = new javax.swing.JTextField();
            jLabel2 = new javax.swing.JLabel();
            cost5 = new javax.swing.JTextField();
            cost10 = new javax.swing.JTextField();
            cost8 = new javax.swing.JTextField();
            cost9 = new javax.swing.JTextField();
            cost6 = new javax.swing.JTextField();
            cost7 = new javax.swing.JTextField();
            cost1 = new javax.swing.JTextField();
            cost2 = new javax.swing.JTextField();
            cost3 = new javax.swing.JTextField();
            cost4 = new javax.swing.JTextField();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            amt2 = new javax.swing.JTextField();
            amt1 = new javax.swing.JTextField();
            amt4 = new javax.swing.JTextField();
            amt3 = new javax.swing.JTextField();
            amt10 = new javax.swing.JTextField();
            amt5 = new javax.swing.JTextField();
            amt7 = new javax.swing.JTextField();
            amt6 = new javax.swing.JTextField();
            amt9 = new javax.swing.JTextField();
            amt8 = new javax.swing.JTextField();
            total1 = new javax.swing.JLabel();
            total2 = new javax.swing.JLabel();
            total4 = new javax.swing.JLabel();
            total3 = new javax.swing.JLabel();
            total8 = new javax.swing.JLabel();
            total7 = new javax.swing.JLabel();
            total6 = new javax.swing.JLabel();
            total5 = new javax.swing.JLabel();
            total9 = new javax.swing.JLabel();
            total10 = new javax.swing.JLabel();
            sale = new javax.swing.JTextField();
            jLabel15 = new javax.swing.JLabel();
            ahcheck = new javax.swing.JCheckBox();
            profit = new javax.swing.JLabel();
            CalculateButton = new javax.swing.JButton();
    
            mainPanel.setName("Profit Calculator"); // NOI18N
    
            org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(profitcalculator.ProfitCalculatorApp.class).getContext().getResourceMap(ProfitCalculatorView.class);
            jLabel1.setFont(resourceMap.getFont("Profit Calculator.font")); // NOI18N
            jLabel1.setText(resourceMap.getString("Profit Calculator.text")); // NOI18N
            jLabel1.setName("Profit Calculator"); // NOI18N
    
            jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N
            jTextField1.setName("jTextField1"); // NOI18N
    
            jTextField2.setName("jTextField2"); // NOI18N
    
            jTextField3.setName("jTextField3"); // NOI18N
    
            jTextField4.setName("jTextField4"); // NOI18N
    
            jTextField5.setName("jTextField5"); // NOI18N
    
            jTextField6.setName("jTextField6"); // NOI18N
    
            jTextField7.setName("jTextField7"); // NOI18N
    
            jTextField8.setName("jTextField8"); // NOI18N
    
            jTextField9.setName("jTextField9"); // NOI18N
    
            jTextField10.setName("jTextField10"); // NOI18N
    
            jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
            jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
            jLabel2.setName("jLabel2"); // NOI18N
    
            cost5.setName("cost5"); // NOI18N
    
            cost10.setName("cost10"); // NOI18N
    
            cost8.setName("cost8"); // NOI18N
    
            cost9.setName("cost9"); // NOI18N
    
            cost6.setName("cost6"); // NOI18N
    
            cost7.setName("cost7"); // NOI18N
    
            cost1.setName("cost1"); // NOI18N
    
            cost2.setName("cost2"); // NOI18N
    
            cost3.setName("cost3"); // NOI18N
    
            cost4.setName("cost4"); // NOI18N
    
            jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
            jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
            jLabel3.setName("jLabel3"); // NOI18N
    
            jLabel4.setFont(resourceMap.getFont("jLabel4.font")); // NOI18N
            jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
            jLabel4.setName("jLabel4"); // NOI18N
    
            amt2.setName("amt2"); // NOI18N
    
            amt1.setName("amt1"); // NOI18N
    
            amt4.setName("amt4"); // NOI18N
    
            amt3.setName("amt3"); // NOI18N
    
            amt10.setName("amt10"); // NOI18N
    
            amt5.setName("amt5"); // NOI18N
    
            amt7.setName("amt7"); // NOI18N
    
            amt6.setName("amt6"); // NOI18N
    
            amt9.setName("amt9"); // NOI18N
    
            amt8.setName("amt8"); // NOI18N
    
            total1.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total1.setText(resourceMap.getString("total1.text")); // NOI18N
            total1.setName("total1"); // NOI18N
    
            total2.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total2.setText(resourceMap.getString("total2.text")); // NOI18N
            total2.setName("total2"); // NOI18N
    
            total4.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total4.setText(resourceMap.getString("total4.text")); // NOI18N
            total4.setName("total4"); // NOI18N
    
            total3.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total3.setText(resourceMap.getString("total3.text")); // NOI18N
            total3.setName("total3"); // NOI18N
    
            total8.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total8.setText(resourceMap.getString("total8.text")); // NOI18N
            total8.setName("total8"); // NOI18N
    
            total7.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total7.setText(resourceMap.getString("total7.text")); // NOI18N
            total7.setName("total7"); // NOI18N
    
            total6.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total6.setText(resourceMap.getString("total6.text")); // NOI18N
            total6.setName("total6"); // NOI18N
    
            total5.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total5.setText(resourceMap.getString("total5.text")); // NOI18N
            total5.setName("total5"); // NOI18N
    
            total9.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total9.setText(resourceMap.getString("total9.text")); // NOI18N
            total9.setName("total9"); // NOI18N
    
            total10.setFont(resourceMap.getFont("total3.font")); // NOI18N
            total10.setText(resourceMap.getString("total10.text")); // NOI18N
            total10.setName("total10"); // NOI18N
    
            sale.setText(resourceMap.getString("sale.text")); // NOI18N
            sale.setName("sale"); // NOI18N
    
            jLabel15.setFont(resourceMap.getFont("jLabel15.font")); // NOI18N
            jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
            jLabel15.setName("jLabel15"); // NOI18N
    
            ahcheck.setFont(resourceMap.getFont("ahcheck.font")); // NOI18N
            ahcheck.setText(resourceMap.getString("ahcheck.text")); // NOI18N
            ahcheck.setName("ahcheck"); // NOI18N
    
            profit.setFont(resourceMap.getFont("profit.font")); // NOI18N
            profit.setText(resourceMap.getString("profit.text")); // NOI18N
            profit.setName("profit"); // NOI18N
    
            CalculateButton.setFont(resourceMap.getFont("CalculateButton.font")); // NOI18N
            CalculateButton.setText(resourceMap.getString("CalculateButton.text")); // NOI18N
            CalculateButton.setName("CalculateButton"); // NOI18N
            CalculateButton.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    CalculateButtonMouseClicked(evt);
                }
            });
    
            javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
            mainPanel.setLayout(mainPanelLayout);
            mainPanelLayout.setHorizontalGroup(
                mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(mainPanelLayout.createSequentialGroup()
                    .addGap(18, 18, 18)
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(mainPanelLayout.createSequentialGroup()
                            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(mainPanelLayout.createSequentialGroup()
                                    .addComponent(sale, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(ahcheck))
                                .addComponent(jLabel15)
                                .addComponent(profit))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 212, Short.MAX_VALUE)
                            .addComponent(CalculateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 227, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(28, 28, 28))
                        .addGroup(mainPanelLayout.createSequentialGroup()
                            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1)
                                .addGroup(mainPanelLayout.createSequentialGroup()
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel2))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel3)
                                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(cost10)
                                            .addComponent(cost9)
                                            .addComponent(cost8)
                                            .addComponent(cost7)
                                            .addComponent(cost6)
                                            .addComponent(cost5)
                                            .addComponent(cost4)
                                            .addComponent(cost3)
                                            .addComponent(cost2)
                                            .addComponent(cost1, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(amt10)
                                            .addComponent(amt9)
                                            .addComponent(amt8)
                                            .addComponent(amt7)
                                            .addComponent(amt6)
                                            .addComponent(amt5)
                                            .addComponent(amt4)
                                            .addComponent(amt3)
                                            .addComponent(amt2)
                                            .addComponent(amt1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addComponent(jLabel4))
                                    .addGap(18, 18, 18)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(total2)
                                        .addComponent(total1)
                                        .addComponent(total3)
                                        .addComponent(total4)
                                        .addComponent(total5)
                                        .addComponent(total6)
                                        .addComponent(total7)
                                        .addComponent(total8)
                                        .addComponent(total9)
                                        .addComponent(total10))))
                            .addContainerGap(283, Short.MAX_VALUE))))
            );
            mainPanelLayout.setVerticalGroup(
                mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(CalculateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(mainPanelLayout.createSequentialGroup()
                            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(mainPanelLayout.createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addGap(39, 39, 39)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel2)
                                        .addComponent(jLabel3))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(mainPanelLayout.createSequentialGroup()
                                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(mainPanelLayout.createSequentialGroup()
                                            .addComponent(cost1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cost10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addGroup(mainPanelLayout.createSequentialGroup()
                                    .addComponent(jLabel4)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total1))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total2))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total3))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total4))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total5))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total6))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total7))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total8))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total9))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(amt10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(total10))))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                            .addComponent(jLabel15)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(sale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(ahcheck))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(profit)))
                    .addGap(15, 15, 15))
            );
    
            setComponent(mainPanel);
        }// </editor-fold>                        
    
        private void CalculateButtonMouseClicked(java.awt.event.MouseEvent evt) {                                             
    
           int[] mat = new int[10];
         JTextField[] cost = new JTextField[10];
        cost[0] = cost1;
        cost[1] = cost2;
        cost[2] = cost3;
        cost[3] = cost4;
        cost[4] = cost5;
        cost[5] = cost6;
        cost[6] = cost7;
        cost[7] = cost8;
        cost[8] = cost9;
        cost[9] = cost10;
        
        for(int i=0; i<10; i++) { 
            if(cost[i].getText().equals("")) {
                cost[i].setText("0");
            }   
        mat[i] =  Integer.parseInt(cost[i].getText());
       }
        
        int[] need = new int[10];
        JTextField[] amt = new JTextField[10];
        amt[0] = amt1;
        amt[1] = amt2;
        amt[2] = amt3;
        amt[3] = amt4;
        amt[4] = amt5;
        amt[5] = amt6;
        amt[6] = amt7;
        amt[7] = amt8;
        amt[8] = amt9;
        amt[9] = amt10;
        
        for(int i=0; i<10; i++) { 
            if(amt[i].getText().equals("")) {
                amt[i].setText("0");
            }   
        need[i] =  Integer.parseInt(amt[i].getText());
       }
        
        JLabel[] totals = new JLabel[10];
        totals[0] = total1;
        totals[1] = total2;
        totals[2] = total3;
        totals[3] = total4;
        totals[4] = total5;
        totals[5] = total6;
        totals[6] = total7;
        totals[7] = total8;
        totals[8] = total9;
        totals[9] = total10;
        
        int[] total = new int[10];
        for(int i=0; i < 10;i++) { 
            total[i] = mat[i] * need[i];
        }
         for(int i=0; i<10; i++) { 
            totals[i].setText("Total Cost: " + Integer.toString(total[i]));
         }
         int finalcost = total[0] + total[1] + total[2] + total[3] + total[4] + total[5] + total[6] + total[7] + total[8] + total[9];
         int saleprice = Integer.parseInt(sale.getText());
      
         if(ahcheck.isSelected()){
            double math = (saleprice - finalcost)*.95;
            int profits = (int)math;
         profit.setText("Profit: " + profits + " Gold");
         math = 0;
         profits = 0;
         }
         else { 
          double math = (saleprice - finalcost);
          int profits = (int)math;
          profit.setText("Profit: " + profits + " Gold");
          math = 0;
          profits = 0;
         }
         
        }                                            
    
    
        // Variables declaration - do not modify                     
        private javax.swing.JButton CalculateButton;
        private javax.swing.JCheckBox ahcheck;
        private javax.swing.JTextField amt1;
        private javax.swing.JTextField amt10;
        private javax.swing.JTextField amt2;
        private javax.swing.JTextField amt3;
        private javax.swing.JTextField amt4;
        private javax.swing.JTextField amt5;
        private javax.swing.JTextField amt6;
        private javax.swing.JTextField amt7;
        private javax.swing.JTextField amt8;
        private javax.swing.JTextField amt9;
        private javax.swing.JTextField cost1;
        private javax.swing.JTextField cost10;
        private javax.swing.JTextField cost2;
        private javax.swing.JTextField cost3;
        private javax.swing.JTextField cost4;
        private javax.swing.JTextField cost5;
        private javax.swing.JTextField cost6;
        private javax.swing.JTextField cost7;
        private javax.swing.JTextField cost8;
        private javax.swing.JTextField cost9;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel15;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JTextField jTextField1;
        private javax.swing.JTextField jTextField10;
        private javax.swing.JTextField jTextField2;
        private javax.swing.JTextField jTextField3;
        private javax.swing.JTextField jTextField4;
        private javax.swing.JTextField jTextField5;
        private javax.swing.JTextField jTextField6;
        private javax.swing.JTextField jTextField7;
        private javax.swing.JTextField jTextField8;
        private javax.swing.JTextField jTextField9;
        private javax.swing.JPanel mainPanel;
        private javax.swing.JLabel profit;
        private javax.swing.JTextField sale;
        private javax.swing.JLabel total1;
        private javax.swing.JLabel total10;
        private javax.swing.JLabel total2;
        private javax.swing.JLabel total3;
        private javax.swing.JLabel total4;
        private javax.swing.JLabel total5;
        private javax.swing.JLabel total6;
        private javax.swing.JLabel total7;
        private javax.swing.JLabel total8;
        private javax.swing.JLabel total9;
        // End of variables declaration                   
    
        private final Timer messageTimer;
        private final Timer busyIconTimer;
        private final Icon idleIcon;
        private final Icon[] busyIcons = new Icon[15];
        private int busyIconIndex = 0;
    
        private JDialog aboutBox;
        
    }
    [/spoiler]

    Here is a screenshot of it in action calculating profit of Plans: Warboots of Mighty Lords - Item - World of Warcraft if you sell it for 45k on my server. I don't know exact ah prices but I'm guessing they will be close.

    Not selling on AH:



    Selling on AH:




    Download:http://www.multiupload.com/E5KGCVEDW0

    Virus Scan: https://www.virustotal.com/file-scan...53d-1311302400

    Please enjoy!

    ~Confucius

    I know it's pretty crappy looking and done but it can be very useful if you craft stuff to sell a lot, for example i craft vial of sands to resell often so I find it useful.



    UPDATE!!!

    I have updated profit calculator to work with gold and silver! It has been updated to work with gold and silver. All whole numbers are gold, then tenths and hundredths are silver, the next two digits are copper and anything after is fractions of copper. For Example 1.7011 is equal to 1 gold 70 silver and 11 copper.

    The download above has been updated.

    Last edited by Confucius; 07-23-2011 at 02:11 PM.

    Profit Calculator 2.0
  2. #2
    QtDemon's Avatar Contributor
    Reputation
    180
    Join Date
    Nov 2010
    Posts
    498
    Thanks G/R
    50/14
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow simple, but very handy! Thanks a lot for this. +rep.

  3. #3
    SprayPlaster's Avatar Sergeant Major
    Reputation
    13
    Join Date
    Feb 2010
    Posts
    164
    Thanks G/R
    0/0
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice! 10 chars

  4. #4
    Traxex84's Avatar Contributor Authenticator enabled
    Reputation
    257
    Join Date
    May 2010
    Posts
    816
    Thanks G/R
    1/25
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +rep Very cool idea, I can do the math faster in my head but I am sure lots of people will love this

  5. #5
    Confucius's Avatar Panda of Worlds The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1389
    Join Date
    Oct 2007
    Posts
    2,590
    Thanks G/R
    267/283
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks everyone, I know I love it, I just now had to use it to see if it was worth it to buy mats to craft these flasks or not!

  6. #6
    Subset's Avatar Vanaka
    Reputation
    355
    Join Date
    Nov 2009
    Posts
    603
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    :O panda learns well from chinese economy
    +Rep x4

    [e] Cannot do, must spread/too much rep given

  7. #7
    Confucius's Avatar Panda of Worlds The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1389
    Join Date
    Oct 2007
    Posts
    2,590
    Thanks G/R
    267/283
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks megabat

  8. #8
    Harambeqt's Avatar Elite User CoreCoins Purchaser
    Reputation
    333
    Join Date
    Mar 2010
    Posts
    1,206
    Thanks G/R
    9/29
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +Rep Pandas!....
    Support the #1 WoW Emulator:
    http://arcemu.org/
    https://github.com/arcemu/arcemu
    - - -

  9. #9
    NightUndead's Avatar Member
    Reputation
    13
    Join Date
    Sep 2008
    Posts
    51
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude, implementing silver and copper is crap easy.
    Just treat them as the last 4 digits of the integer. Easy peasy.

    Also:
    I haven't programmed in java (except for some Minecraft Mods), but if its event driven, you could bind the calculate method to when text is changed in all the other boxes.
    Last edited by NightUndead; 07-22-2011 at 03:13 PM.

  10. #10
    Confucius's Avatar Panda of Worlds The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1389
    Join Date
    Oct 2007
    Posts
    2,590
    Thanks G/R
    267/283
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by NightUndead View Post
    Dude, implementing silver and copper is crap easy.
    Just treat them as the last 4 digits of the integer. Easy peasy.

    Also:
    I haven't programmed in java (except for some Minecraft Mods), but if its event driven, you could bind the calculate method to when text is changed in all the other boxes.
    I didn't add copper and silver because I don't see the point in it :P

  11. #11
    TheLordJesusHimself's Avatar Elite User Fuck am not Jewish. Authenticator enabled
    Reputation
    333
    Join Date
    Jun 2011
    Posts
    676
    Thanks G/R
    141/268
    Trade Feedback
    4 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    gonna help me out alot thanks mate

  12. #12
    Blinky's Avatar Active Member
    Reputation
    23
    Join Date
    May 2007
    Posts
    184
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Will try it out, thank you very much. +Rep!
    wut

  13. #13
    DDDevilz's Avatar Member
    Reputation
    98
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Confucius View Post
    I didn't add copper and silver because I don't see the point in it :P
    Why not round the single digit of the gold amount, then? The silver (and copper, to a lesser extent) certainly start to add up.

  14. #14
    Confucius's Avatar Panda of Worlds The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1389
    Join Date
    Oct 2007
    Posts
    2,590
    Thanks G/R
    267/283
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by DDDevilz View Post
    Why not round the single digit of the gold amount, then? The silver (and copper, to a lesser extent) certainly start to add up.
    I will add copper and silver later then.

  15. #15
    Confucius's Avatar Panda of Worlds The Idiot

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1389
    Join Date
    Oct 2007
    Posts
    2,590
    Thanks G/R
    267/283
    Trade Feedback
    7 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I have updated it to work with silver and copper, by converting all ints into doubles. So 1.7 is equal to 1 gold 7 silver, ect. Very handy if you need ore and you don't want to go by stacks of 5 or something you can just say one ore costs 1.7 and then enter say 12 if you need 6 bars :P Enjoy!

Page 1 of 2 12 LastLast

Similar Threads

  1. [Tool] Herb Profit Calculator
    By aznboy in forum World of Warcraft Bots and Programs
    Replies: 17
    Last Post: 02-01-2013, 04:43 PM
  2. RMAH Profit Calculator
    By aminios in forum Diablo 3 Bots and Programs
    Replies: 10
    Last Post: 07-23-2012, 10:00 AM
  3. Very simple AH profit calculator
    By Ru1n3r in forum Diablo 3 Guides
    Replies: 4
    Last Post: 05-31-2012, 12:20 PM
  4. [Tool] Profit Calculator
    By Confucius in forum World of Warcraft Bots and Programs
    Replies: 8
    Last Post: 11-30-2010, 05:04 PM
  5. [Program] Profit Calculator for JC Vendoring
    By luchin in forum World of Warcraft Bots and Programs
    Replies: 10
    Last Post: 06-08-2010, 05:52 PM
All times are GMT -5. The time now is 03:20 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search