Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You may want to look at some of the resources posted here in the FAQ thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

1) I said move, not remove.
2) Yes, unless you want 'number' to be set to the number of bytes read on each invocation of that statement in your loop - which negates the whole point of incrementing it inside the loop as a counter.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would just point out that you are checking the entry against the string in array[1] every single time, but showing a value based on your generator array[generator1-1] in the JOptionPane

a = array[1].indexOf(guess);
JOptionPane.showMessageDialog(null, "" + guess + " " + array[generator1-1] + "  "+ a);
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The value of 'number' is what you are wanting to return, since that is your counter variable. Of course, you will have to declare it above the try-catch block to do so... and not reset it every read iteration with this part number = stream.read()

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You defined number in the try block. It is out of scope in the finally block. Even if it weren't, it's the stream that you want to check for null - not the number.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You read from 'stream'. That is your InputStream object that is being passed into the method.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You have those backward. I don't think you intend to read() from 'number'.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ok, change your Window class constructor just a bit to this

public Window(){
        super();
        scene=new Scene();
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(scene,BorderLayout.CENTER);

        setSize(400,600);
        setLocation(300,100);
        setVisible(true);
        setResizable(false);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        requestFocus();
    }

The main difference is adding your "Scene" panel to the content pane of the JFrame and doing it before the setSize() and setResizable() calls.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try adding the entire path to your image file. It may just be a resource location issue. If that works, you may want to use getResource() for locating the file resources as discussed in this tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html#getresource

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ok, my apologies, I tried to merge these two threads and it came out a bit of a mess. Hopefully something relevant can still be salvaged.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'd say the extra '=' sign here is causing your problem

Where = qryExams.Dept_ID

Edit: Well, and the fact you can't refer to "qryDept.Dept_ID" if you haven't joined to qryDept in that query. In short, your second SQL statement is completely invalid.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Uploaded attachment:

Works just fine from here. (Firefox 3.0.10)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your original version was evaluating

(not a) equal to (b)

when you wanted

(a) not equal to (b)
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You would want the clause to be m=$todaysMonth AND d=$todaysDay AND y=$todaysYear

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why not set the parameters of your query to only pull records where m=$todaysMonth and d=$todaysDay and y=$todaysYear?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, that should be the case. If you're using netbeans to debug it, set a break point on the switch statement.

One note on your switch though. If you want to it to perform like the series of if() statements you had earlier, you need to remove the break statements and let the cases fall through so they are additive.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Are you certain that you have added the listeners to the jComboBox1 control? You would need to post the full code to track it down further.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Glad to hear it :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

"setValueAt()" needs to set that value in your rosterList data, so it should be

public void setValueAt(Object value, int row, int col) {
    if (value != null) {
        rosterList.get(row)[col] = String.valueOf(value);
        fireTableCellUpdated(row, col);
    }
}

The null check prevents if from putting the word "null" in the cell if you select the combobox cell but do not select a value.

Edit: I also forgot to mention that this loop for(int index = 1; index == 27; index++) will never execute because 1 != 27 on the first check. I think you meant index < 27;

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That is certainly a possibility. The larger problem is keeping up with all of the ambiguous fields like "someTextField999" and it's relation to "randomLabel645". In the long run, designing an object model that manages these things in appropriate collections like Lists of other objects would be a much more manageable way forward.

(Not to denigrate peace_of_mind's suggestion, which is helpful in the context of the huge tangle of UI code that was posted)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You don't mention the language, but if it's Java then using arraylist.get(i).move(); as you have it there will move that instance in the list. It will not create a copy.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It certainly does look invalid and only works with specifically typed Lists - definitely an easy candidate to trip the syntax alarm bells :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Any suggestions as to why its saying I can't set it up with my .getSelectedIndex() ?

The only problems I really saw with the if() block code you posted up above was the lack of parenthesis for the "getSelectedIndex" method calls and the condition statement on the else portion, which I mentioned previously. If neither of those are the problem, you'll need to post the exact error message and stack trace.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As for an array of text fields, all in all it would still be just about as many lines of code but it would look cleaner to do it that way.

Well, I would say this is a few less lines

for (int i=0; i<jComboBox1.getSelectedIndex(); i++) {
    textFields[i].setVisible(true);
}

A fall-through switch is more hard-coding than I would prefer, but still far fewer than that if-else block (which could really be just a series of if() statements to eliminate the repetitive statements.)

switch (jComboBox1.getSelectedIndex()){
    case 2:
        cTextField.setVisible(true);
        // fall through
    case 1:
        bTextField.setVisible(true);
        // fall through
    case 0:
        aTextField.setVisible(true);
}
KirkPatrick commented: Thank you for further explaining that for me. To top it off, in a kind manner which not too many people do these days. Cheers bud +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The ArrayList of String[] is not really a problem if you want to keep it, but you need to add space to store the data for the column you are adding. To do that, you would need to copy the split() result to a larger array

while (line != null )
      {
        String [] rowfields = line.split("[ ]+");
        // copy into a new array that is one element larger
        String[] columnData =  Arrays.copyOf(rowfields, rowfields.length + 1);
        rosterList.add(columnData);
        
        line = br.readLine();
       }
    }

You could, of course, also use a List or Vector to hold your row data, but that would require changing more of your existing code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There is no condition on an "else" clause, so this isn't valid syntax

else (jComboBox1.getSelectedIndex == 9)

.

The bigger question is why not use a switch or even better yet, an array of text fields so you don't have so much manually repetitive code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

How should I know? I can't see over your shoulder from here. You didn't post nearly enough information about what you were trying to execute or a detailed error message. If you supply a bit more information, someone might be able to help straighten it out.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

MySpace and Facebook are also options if you're just wanting a place to post up family pics and such.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It means you tried to run something that doesn't have a class definition. You are probably in the wrong directory.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That syntax actually does work fine with something like List<String[]>. I would imagine you are getting that error because you did not add an element in the 'rosterList' arrays to hold the data for that column you added to your model. Your model needs to also have a place to store that column data, which entails more than just adding a column name for it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Many ISPs offer a small amount of web space for a personal page with your account. I would check with your service provider first.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, you cannot put images in text boxes. You can use JLabels for that pretty easily. Here's a tutorial on using Image Icons that might help: http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, I don't see how you expect anyone to help you when you did not post a question.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The rest of the error stack trace would tell you which line the error is occurring on. Read it carefully and you won't have to "think it's got something to do with" anything - you'll know.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There is a rather lengthy discussion about fixing this here if you need to try a few other things. A co-worker of mine had the same problem recently with an older laptop he picked up and he fixed it by actually clipping the wire to the thing, but you might not want to go that far just yet :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try disabling the "Pointing Stick" (the little mouse nubby thing that's in the middle of the keyboard) in the mouse section of your control panel.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, you're not going to find anyone here that will just "give you the code for it". It's all about showing some effort and asking specific questions if you're stuck.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Using the build in tools for it doesn't look too tricky: http://www.eclipse-blog.org/eclipse-ide/generating-javadoc-in-eclipse-ide.html

If there are specific parts you don't understand, post a more detailed explanation of what you're hung up on.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Until recently, we thought that mushrooms were the organism when they are just the sexual organs of a much larger organism.

Eww, I stepped on a couple in my yard yesterday - I didn't know I was tromping on something's privates :icon_eek:

jephthah commented: aha +9
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would give serious consideration to doing it in VB.NET or C# instead. VB6 is legacy work at this point.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Don't rely on getParent() for getting back to your JFrame. Create a constructor for your panels that takes a reference to that frame as a parameter. All of your panels will then be able to make requests on the main frame. If you create methods such as loadNext() on your frame class then the panels can simply call that and not worry about the mechanics of swapping them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The Mathematics of the 3D Rotation Matrix might be worth a read for you. If it's too deep at the moment, perhaps it will be helpful as you get in further.

Gamedev has many articles on matrices as well if you want to peruse them: http://www.gamedev.net/reference/list.asp?categoryid=28#259

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Looks like it would probably be pretty handy, but it will still require some study and understanding of the api. They do have some examples here: http://wiki.modularity.net.au/ical4j/index.php?title=Examples#Creating_a_new_calendar that might help.

To the OP, it still just comes down to translating your own calendar object entries to a standard documented text interchange format. You have properties that you must write as entries into a text file in based upon that specification. To import, you have to read those entries and put the info into your own objects.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

vCal spec can be found here: http://www.imc.org/pdi/pdiproddev.html

I found plenty more info on iCal with a simple Google search. Have you looked at any of that?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sure, assuming that each sale record had a "Qty" for quantity sold, you'd just have something like

SELECT StyleID, SUM(Qty) FROM Sales GROUP BY StyleID ORDER BY SUM(Qty) DESC
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Was that supposed to be comprehensible? Anyhow, you need to figure out which forum is appropriate for your questions and then post a more detailed question there. Posting your assignment isn't going to cut it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

AncientDragon was referring to which course you are currently taking that involves the projects you mentioned. Our forums here are grouped by subject, such as C++, Java, Database Design, etc. as you will see if you peruse through them. Without knowing what course you are taking and or what languages you're using, it's impossible to direct you to the correct forum or move this post there.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Then use the "!" not operator.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, sorry, I guess I wasn't very clear. I had a scenario like what Vernon mentions above in mind when I said that the component starts with a cleared background. I was assuming a call to super.paintComponent() before any other painting.