Accessing data from another class Java
<p>Okay, this is total noob stuff, and this is a simple concept I just cannot grasp from everything I've looked at.</p>

<p>Currently I have some a GUI with a JList, when you select the 1st, 2nd, 3rd or whatever thing in the list it gets the respective value from a list. However, I want to move this list to a 'data' class (or all my values are elsewhere, for easier maintainence - and yes I want them hard coded into the software).</p>

<pre><code>new DefaultComboBoxModel(
                        new String[] { "A", "B", "C", "D", "E" });
                        final Double[] letterCost = { 2.5, 1, 1, 1, 2.5 };
</code></pre>

<p>so when someone clicks E, for example, in the JList letterCost is set to 2.5 
I want to move this bit</p>

<pre><code>final Double[] letterCost = { 2.5, 1, 1, 1, 2.5 };
</code></pre>

<p>into another class. I'm over simplifying what I'm actually doing. I just want to get my head around the concept. I've never worked with multiple classes before. </p>

<p>So how would I go about making a new class, having the data in that class, and have it accessed as it currently would be from my original class?</p>

<p>Thanks.. </p>

<p>oh, and if I had something that changed the values (say every time someone picked a letter the value increased by 1), would that continue to work the same?</p>
