need help with JList and combined parallel arrays

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 538 Views - Last Post: 06 December 2015 - 03:52 PM Rate Topic: -----

#1 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

need help with JList and combined parallel arrays

Posted 06 December 2015 - 02:41 AM

So basically, im trying to extract the souvenirs into an array list which i then append it to a jtextarea with all the souvenir and price choices. I have it right now so that it only gets one at a time, but i want it to get all the choices!

I will post Appropriate code to save space

import javax.swing.ImageIcon;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.BorderLayout;
import java.awt.event.*;
import java.awt.*;
import java.util.Locale;
import java.text.NumberFormat;


public class project7 extends JFrame
{
private JList souvList;
private JComboBox freeFood;
private JSlider jsl = new JSlider(SwingConstants.HORIZONTAL,1,10,1);

private String[] itemNames = {"mug","cap","tee shirt","sweat shirt","pennant","mini stick","bobblehead","paper bag","foam paw","thunderstix"};
private double[] prices = {2.0,10.0,15.0,25.0,3.0,5.0,9.0,8.0,12.0,6.0};
private ImageIcon [] iconArray = new ImageIcon[6];
private ImageIcon hawks = new ImageIcon("blackhawks.jpg");


String [] foodIcon = {"bk.png","dd.jpg","dq.png","vb.jpg","mcds.gif","tbell.png"};
String [] foodNames = {"Burger King", "Dunkin Donuts", "Dairy Queen", "Vienna Beef", "Mcdonals", "TacoBell"};

private ButtonGroup seatSelec;
private JRadioButton box, upperBtn, obsView, innerBtn;
private JLabel tName, seatLbl, compLbl, mealLbl, souvLbl, foodLbl, tixLbl;
private JPanel northP, southP, eastP, westP, centerP, orderP;
private JButton cart, clear, exitBtn;

private double tixCost;
private double tixBaseCost = 40.0;
private double subTotal;
private double totalCost;
private double itemCost;
private int numOfTix;
private int index; 

private int[] souvListIndex;
private int[] souvIndex;
private int[] indices;
private String seatSelection;
private String foodName;
private String teamName = "BlackHawks";


private Container c = getContentPane();

NumberFormat moneyfmt = NumberFormat.getCurrencyInstance(Locale.US);//global

Font tFont = new Font("Helvetica",Font.BOLD,38);
Font lFont = new Font("Courier",Font.BOLD+Font.ITALIC,24);
Font f1 = new Font("Courier",Font.ITALIC, 20);
Font f = new Font("Serif",Font.BOLD, 24);

   public static void main (String[] args)
   {
      project7 p7 = new project7();
      p7.setVisible(true);
      p7.setSize(1000,800);
   }//end main
   
   public project7()
   {
     super();
     init();
   }//end project 7
    
   public void total(double itemCost)
      {
         this.itemCost = itemCost;
         subTotal = itemCost;
         totalCost = numOfTix * (tixCost + itemCost);
      }//end 

   public void order()
      {
    
        JTextArea text = new JTextArea(5, 10);  
        text.setFont(f);
        text.setBackground(Color.BLACK);
        text.setForeground(Color.RED);
       
        text.append("TEAM : " + teamName);
        text.append("\nMEAL : " + foodName);
        text.append("\nSEATS : " + seatSelection);
        
          for(int i = 0; i < souvListIndex.length; i++)
              {
                 text.append("\nITEMS ORDERED: " + itemNames[souvListIndex[i]] + "\n" + moneyfmt.format(prices[souvListIndex[i]]));
                 text.append("\n");
                 total(prices[souvListIndex[i]]);
              }//end for
     
        text.append("\nSUBTOTAL:  " + moneyfmt.format(subTotal));
        text.append("\n");
        text.append("\nPACKAGES ORDERED:  " + numOfTix);
        text.append("\n");
        text.append("\nTOTAL COST:  " + moneyfmt.format(totalCost)); 
        orderP.setVisible(true);              
        int choice = JOptionPane.showConfirmDialog(orderP, text, "Your Order ", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, hawks);
       
        if(choice == JOptionPane.YES_OPTION)
          {
            JOptionPane.showMessageDialog(null, "Thank you, your tickets are on the way! ");          
          }//end yes
        if(choice == JOptionPane.NO_OPTION)
          {
            JOptionPane.showMessageDialog(null, "Thank you, please try again later");       
          }//end no
   
      }//end order
   
      
   public void init()
      {
       this.setVisible(true);
       c.setLayout(new BorderLayout()); 
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
       
        
       ////          NORTH     //////////
       
       northP = new JPanel(); 


 souvLbl = new JLabel("Select Souvenirs");
       souvLbl.setFont(lFont);
       souvLbl.setBackground(Color.BLACK);
       souvLbl.setForeground(Color.RED);
       centerP.add(souvLbl);
       
        for (int i = 0; i < iconArray.length; i++)
         {
            iconArray[i]= new ImageIcon(foodIcon[i]);
         }//ends for loop
           
       freeFood = new JComboBox(iconArray);
       freeFood.setBackground(Color.RED);
       freeFood.addItemListener(CH);
       centerP.add(freeFood);
            ///   jlist /////// 
       souvList = new JList(itemNames);
       souvList.setFont(lFont);
       souvList.setForeground(Color.WHITE);
       souvList.setBackground(Color.RED);
       souvList.setVisibleRowCount(5);
       souvList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
       JScrollPane scrollList = new JScrollPane(souvList);
       souvList.addListSelectionListener(new sharedListSelectionListener());
       centerP.add(scrollList);
       
       ////         SOUTH         ////////
       
       southP = new JPanel();
       southP.setLayout(new GridLayout(2,1));




 public class sharedListSelectionListener implements ListSelectionListener
 { 
   public void valueChanged(ListSelectionEvent e)
      {
        souvIndex = souvList.getSelectedIndices();
        souvListIndex = souvIndex;       
      }//end list listener
 }//end class  
 


Thanks for the help i posted everything having to do with it because i don't know much about this. Only saw about 3 slides from my teacher on jslides and even less on parallel arrays.

Is This A Good Question/Topic? 0
  • +

Replies To: need help with JList and combined parallel arrays

#2 NormR   User is offline

  • D.I.C Lover
  • member icon

Reputation: 693
  • View blog
  • Posts: 5,303
  • Joined: 25-December 13

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 04:18 AM

Can you fix the code so it can be compiled and executed for testing? The posted code seems to be missing some parts.

Quote

only gets one at a time, but i want it to get all the choices!

Can you explain why getting the items one at a time fails to get all the choices?
Was This Post Helpful? 0
  • +
  • -

#3 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 12:14 PM

import javax.swing.ImageIcon;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.BorderLayout;
import java.awt.event.*;
import java.awt.*;
import java.util.Locale;
import java.text.NumberFormat;


public class project7 extends JFrame
{
private JList souvList;
private JComboBox freeFood;
private JSlider jsl = new JSlider(SwingConstants.HORIZONTAL,1,10,1);

private String[] itemNames = {"mug","cap","tee shirt","sweat shirt","pennant","mini stick","bobblehead","paper bag","foam paw","thunderstix"};
private double[] prices = {2.0,10.0,15.0,25.0,3.0,5.0,9.0,8.0,12.0,6.0};
private ImageIcon [] iconArray = new ImageIcon[6];
private ImageIcon hawks = new ImageIcon("blackhawks.jpg");


String [] foodIcon = {"bk.png","dd.jpg","dq.png","vb.jpg","mcds.gif","tbell.png"};
String [] foodNames = {"Burger King", "Dunkin Donuts", "Dairy Queen", "Vienna Beef", "Mcdonals", "TacoBell"};

private ButtonGroup seatSelec;
private JRadioButton box, upperBtn, obsView, innerBtn;
private JLabel tName, seatLbl, compLbl, mealLbl, souvLbl, foodLbl, tixLbl;
private JPanel northP, southP, eastP, westP, centerP, orderP;
private JButton cart, clear, exitBtn;

private double tixCost;
private double tixBaseCost = 40.0;
private double subTotal;
private double totalCost;
private double itemCost;
private int numOfTix;
private int index; 

private int[] souvListIndex;
private int[] souvIndex;
private int[] indices;
private String seatSelection;
private String foodName;
private String teamName = "BlackHawks";


private Container c = getContentPane();

NumberFormat moneyfmt = NumberFormat.getCurrencyInstance(Locale.US);//global

Font tFont = new Font("Helvetica",Font.BOLD,38);
Font lFont = new Font("Courier",Font.BOLD+Font.ITALIC,24);
Font f1 = new Font("Courier",Font.ITALIC, 20);
Font f = new Font("Serif",Font.BOLD, 24);

   public static void main (String[] args)
   {
      project7 p7 = new project7();
      p7.setVisible(true);
      p7.setSize(1000,800);
   }//end main
   
   public project7()
   {
     super();
     init();
   }//end project 7
    
   public void total(double itemCost)
      {
         this.itemCost = itemCost;
         subTotal = itemCost;
         totalCost = numOfTix * (tixCost + itemCost);
      }//end 

   public void order()
      {
    
        JTextArea text = new JTextArea(5, 10);  
        text.setFont(f);
        text.setBackground(Color.BLACK);
        text.setForeground(Color.RED);
       
        text.append("TEAM : " + teamName);
        text.append("\nMEAL : " + foodName);
        text.append("\nSEATS : " + seatSelection);
        
          for(int i = 0; i < souvListIndex.length; i++)
              {
                 text.append("\nITEMS ORDERED: " + itemNames[souvListIndex[i]] + "\n" + moneyfmt.format(prices[souvListIndex[i]]));
                 text.append("\n");
                 total(prices[souvListIndex[i]]);
              }//end for
     
        text.append("\nSUBTOTAL:  " + moneyfmt.format(subTotal));
        text.append("\n");
        text.append("\nPACKAGES ORDERED:  " + numOfTix);
        text.append("\n");
        text.append("\nTOTAL COST:  " + moneyfmt.format(totalCost)); 
        orderP.setVisible(true);              
        int choice = JOptionPane.showConfirmDialog(orderP, text, "Your Order ", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, hawks);
       
        if(choice == JOptionPane.YES_OPTION)
          {
            JOptionPane.showMessageDialog(null, "Thank you, your tickets are on the way! ");          
          }//end yes
        if(choice == JOptionPane.NO_OPTION)
          {
            JOptionPane.showMessageDialog(null, "Thank you, please try again later");       
          }//end no
   
      }//end order
   
      
   public void init()
      {
       this.setVisible(true);
       c.setLayout(new BorderLayout()); 
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
       
        
       ////          NORTH     //////////
       
       northP = new JPanel(); 
       northP.setBackground(Color.black);
       tName = new JLabel("    _____ BLACKHAWKS TICKETS _____");
       tName.setFont(tFont);
       tName.setBackground(Color.red);  
       tName.setForeground(Color.red);
       northP.add(tName);
       //////         WEST        ///////////
       westP = new JPanel();
       westP.setBackground(Color.red);
       westP.setLayout(new GridLayout(5,1)); 
       GridBagConstraints gBC = new GridBagConstraints();
                  // label
       seatLbl = new JLabel("Click Seat Selection");   
       seatLbl.setFont(lFont);
       seatLbl.setForeground(Color.white);
       
       westP.add(seatLbl);
                 // radiobtns
       changeHandler CH = new changeHandler(); // change handler          
       seatSelec = new ButtonGroup();
       
       
       innerBtn = new JRadioButton("Inner Deck"); 
       innerBtn.setFont(f1);
       innerBtn.setForeground(Color.WHITE);
       innerBtn.setBackground(Color.RED);   
       seatSelec.add(innerBtn);
       innerBtn.addItemListener(CH);
       westP.add(innerBtn);
       
       upperBtn = new JRadioButton("Upper Deck");
       upperBtn.setFont(f1);
       upperBtn.setBackground(Color.RED);
       upperBtn.setForeground(Color.WHITE);
       seatSelec.add(upperBtn);
       upperBtn.addItemListener(CH);
       westP.add(upperBtn);
       
       obsView = new JRadioButton("Obstructed View");
       obsView.setFont(f1);
       obsView.setBackground(Color.RED);
       obsView.setForeground(Color.WHITE);
       seatSelec.add(obsView);
       obsView.addItemListener(CH);
       westP.add(obsView);
       
       box = new JRadioButton("Luxury Box Seats");
       box.setFont(f1);
       box.setForeground(Color.WHITE);
       box.setBackground(Color.RED);
       seatSelec.add(box);
       box.addItemListener(CH);
       westP.add(box);
       
       ///////       EAST         ///////// 
       ButtonHandler BH = new ButtonHandler(); // button handler
       eastP = new JPanel();
       eastP.setBackground(Color.red);
       eastP.setLayout(new GridLayout(4,1));
       
       
       compLbl = new JLabel("Click to Complete");
       compLbl.setFont(lFont);
       compLbl.setForeground(Color.white);
       eastP.add(compLbl);
                // buttons
       cart = new JButton("Add To Cart");
       cart.setFont(f1);
       cart.setMnemonic(KeyEvent.VK_C);
       cart.setToolTipText("Click to continue to checkout");
       cart.addActionListener(BH);
       eastP.add(cart);
       
       clear = new JButton("Clear Order");
       clear.setFont(f1);

       clear.setMnemonic(KeyEvent.VK_L);
       clear.setToolTipText("Click to start over");
       clear.addActionListener(BH);
       eastP.add(clear);
       
       exitBtn = new JButton("Exit");
       exitBtn.setFont(f1);
       exitBtn.setMnemonic(KeyEvent.VK_E);
       exitBtn.setToolTipText("click to leave the page");
       exitBtn.addActionListener(BH);
       eastP.add(exitBtn);
       
       
       
       ////         CENTER         ///////////
       centerP = new JPanel();
       centerP.setLayout(new GridLayout(2,2));
       centerP.setBackground(Color.BLACK);
       
       mealLbl = new JLabel("Free Meal From:");
       mealLbl.setFont(lFont);
       mealLbl.setBackground(Color.BLACK);
       mealLbl.setForeground(Color.RED);
       centerP.add(mealLbl);
       
       souvLbl = new JLabel("Select Souvenirs");
       souvLbl.setFont(lFont);
       souvLbl.setBackground(Color.BLACK);
       souvLbl.setForeground(Color.RED);
       centerP.add(souvLbl);
       
        for (int i = 0; i < iconArray.length; i++)
         {
            iconArray[i]= new ImageIcon(foodIcon[i]);
         }//ends for loop
           
       freeFood = new JComboBox(iconArray);
       freeFood.setBackground(Color.RED);
       freeFood.addItemListener(CH);
       centerP.add(freeFood);
            ///   jlist /////// 
       souvList = new JList(itemNames);
       souvList.setFont(lFont);
       souvList.setForeground(Color.WHITE);
       souvList.setBackground(Color.RED);
       souvList.setVisibleRowCount(5);
       souvList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
       JScrollPane scrollList = new JScrollPane(souvList);
       souvList.addListSelectionListener(new sharedListSelectionListener());
       centerP.add(scrollList);
       
       ////         SOUTH         ////////
       
       southP = new JPanel();
       southP.setLayout(new GridLayout(2,1));
       southP.setBackground(Color.BLACK);
       tixLbl = new JLabel("                     Select number of ticket Packages");
       tixLbl.setFont(lFont);
       tixLbl.setBackground(Color.BLACK);
       tixLbl.setForeground(Color.RED);
       southP.add(tixLbl);
       
       jsl.setMajorTickSpacing(1);
       jsl.setPaintTicks(true);
       jsl.setPaintLabels(true);
       jsl.addChangeListener(new SliderListener());
       southP.add(jsl);
       
       /// ORDER PANEL //////
       orderP = new JPanel();
       orderP.setBackground(Color.WHITE);
       orderP.setVisible(false);
       
         
       ///////    add panels     ////////
       c.add(northP, BorderLayout.NORTH);
       c.add(westP, BorderLayout.WEST);
       c.add(eastP, BorderLayout.EAST);
       c.add(centerP, BorderLayout.CENTER);
       c.add(southP, BorderLayout.SOUTH);
      }//end init
      
     

 public class ButtonHandler implements ActionListener
   {   
   
   public void actionPerformed(ActionEvent e)
      {        
             if(e.getSource() == cart)
         {
           order();
         }//end if
         
       if(e.getSource() == clear)
         {
           
           souvList.clearSelection(); // clear Jlist
           jsl.setValue(0); // clear jslider
           innerBtn.setSelected(false);
           upperBtn.setSelected(false);              // clear radio buttons
           obsView.setSelected(false);
           box.setSelected(false); 
           seatSelec.clearSelection();                       
           freeFood.setSelectedIndex(0); // clear xombo box          
         }//end if
         
       if(e.getSource() == exitBtn)
         {
            System.exit(0);
         }// end if
       
      }//end actionper for cart/clear/exit
   }//end button handler 

 public class changeHandler implements ItemListener
   {
   public void itemStateChanged(ItemEvent e)
     {
        if(e.getStateChange() == ItemEvent.SELECTED)
         {          
          index = freeFood.getSelectedIndex();
          foodName = foodNames[index];                    
         }//end if JCOMBO BOX
         
         if(e.getSource() == innerBtn)
            {
              seatSelection = "Inner Deck";
              tixCost = (tixBaseCost + 12); 
            }//end if
         else if(e.getSource() == upperBtn)
            {
              seatSelection = "Upper Deck";
              tixCost = (tixBaseCost + 4);
            }//end if
         else if (e.getSource() == obsView)
            {
              seatSelection = "Obstructed View";
              tixCost = tixBaseCost;
            }//end if
         else if (e.getSource() == box)
            {
              seatSelection = "Luxury Box Seats";
              tixCost = (tixBaseCost + 20);
            }//end if
     }//end state changed for JCOMBO BOX
   }//end COMBO BOX HANDLER
   
 public class sharedListSelectionListener implements ListSelectionListener
 { 
   public void valueChanged(ListSelectionEvent e)
      {
        souvIndex = souvList.getSelectedIndices();
        souvListIndex = souvIndex;       
      }//end list listener
 }//end class  
 
 public class SliderListener implements ChangeListener
   {
      public void stateChanged(ChangeEvent e)
         {
            JSlider source = (JSlider)e.getSource();
            if (!source.getValueIsAdjusting())
               {
                numOfTix = source.getValue();               
               }//end if
         }//end stateChange
   }//end slide listner
}//end project 7


full code as requested . and it wont put all the choices into the order panel like i want it to
Was This Post Helpful? 0
  • +
  • -

#4 NormR   User is offline

  • D.I.C Lover
  • member icon

Reputation: 693
  • View blog
  • Posts: 5,303
  • Joined: 25-December 13

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 12:25 PM

Quote

it wont put all the choices into the order panel

Can you describe what choices are put into the panel and what choices are left out?
What should the correctly filled order panel contain?
Was This Post Helpful? 0
  • +
  • -

#5 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 12:31 PM

everything that is currently in the order panel. the team name, the logo, the name of the fast food place, the name of the seat choice, multiple souvenirs that were clicked and their price, Then subtotal should be all of the souvenirs cost added together. packages order is the amount you choose on the slider (which doesn't work if you don't click it for some reason, it defaults at 0 which i need it to default at 1), then the total cost is the slider number * the seat choice + souvenir cost

everything here works except it will only grab 1 souv choice and display that information instead of multiple souv choices like i want it to, and the slider defaulting at 0 instead of defaulting at 1.
Was This Post Helpful? 0
  • +
  • -

#6 NormR   User is offline

  • D.I.C Lover
  • member icon

Reputation: 693
  • View blog
  • Posts: 5,303
  • Joined: 25-December 13

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 12:36 PM

Please explain how a user should interact with the program.
What should the user do? What selections made and/or what buttons should be pressed?
Then what should the program do?
Then what does the user do?
etc

Where in the steps listed above does the program go wrong?
Was This Post Helpful? 0
  • +
  • -

#7 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 12:50 PM

the user clicks a seat selection, clicks the jcombo box to choose a fast food place where they want a free meal, clicks the souviner jlist to tell which souvenirs they want to order. Then they select the number of packages they want to order with the ticks on the Jslider. after that they click add to cart which brings up the order panel with all their custom choices and displays the cost (subtotal: (souviners added together )and total (souviners added to the ticket choice * the number of packages)).


everything here works except it will only grab 1 souv choice and display that information instead of multiple souv choices like i want it to, and the slider defaulting at 0 instead of defaulting at 1.

and when i say defaulting at 0 i mean if i don't click anything on the jslider and the tick mark is at 1 (it will mark the variable it is assigned to as 0 instead of 1) i think i can fix that with just assigning the variable to 1 if slider was not changed but i don't know the syntax.
Was This Post Helpful? 0
  • +
  • -

#8 NormR   User is offline

  • D.I.C Lover
  • member icon

Reputation: 693
  • View blog
  • Posts: 5,303
  • Joined: 25-December 13

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 12:56 PM

Quote

it will only grab 1 souv choice and display that information instead of multiple souv choices like i want it to

When I selected 3 souvs: mug, cap and tee shirt and pressed the Add to cart, the display showed those 3 items.
Was This Post Helpful? 0
  • +
  • -

#9 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 01:03 PM

o thats interesting, how would i go about changing it so you don't have to cnt + click

This post has been edited by sublimeaces: 06 December 2015 - 01:03 PM

Was This Post Helpful? 0
  • +
  • -

#10 NormR   User is offline

  • D.I.C Lover
  • member icon

Reputation: 693
  • View blog
  • Posts: 5,303
  • Joined: 25-December 13

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 01:05 PM

Check the API doc for the class to see what can be set to change its behavior.
Was This Post Helpful? 0
  • +
  • -

#11 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 01:11 PM

alright thanks for taking the time. and is my idea correct about setting a default if slider state not changed?
Was This Post Helpful? 0
  • +
  • -

#12 NormR   User is offline

  • D.I.C Lover
  • member icon

Reputation: 693
  • View blog
  • Posts: 5,303
  • Joined: 25-December 13

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 01:13 PM

Does it work as you want it to?
Was This Post Helpful? 0
  • +
  • -

#13 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 01:13 PM

no like i have said multiple times
Was This Post Helpful? 0
  • +
  • -

#14 NormR   User is offline

  • D.I.C Lover
  • member icon

Reputation: 693
  • View blog
  • Posts: 5,303
  • Joined: 25-December 13

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 01:19 PM

Quote

setting a default if slider state not changed?

I was asking about the change you were going to make for that.
Did you make the change? Did it work?
Was This Post Helpful? 0
  • +
  • -

#15 sublimeaces   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 13-April 14

Re: need help with JList and combined parallel arrays

Posted 06 December 2015 - 01:25 PM

i don't know how lol
if (!source.getValueIsAdjusting())
               {
                numOfTix = source.getValue();               
                }//end if


so would i do
  if(source.getValueIsadjusting())
           {
             numOfTix = 1;
           }//end if


didn't work

This post has been edited by sublimeaces: 06 December 2015 - 01:22 PM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2