Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You mentioned the OpenOffice API above. Have you tried that? I know they have a java-based API for automation, but I haven't used it personally.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hmm, I thought the genius bar was set a little higher.

Read carefully the API doc on hasNext(), especially the part about not advancing. Once you actually get the token, you want to compare that with "input", not the scanner "mob".

Also, for future reference, don't create multiple threads for your question. One will suffice.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Netbeans does allow you to work in GridBagLayout (or several others) from the designer if you set it yourself. It defaults to GroupLayout though, which is hideous to read.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This is the Introductions forum - not the "Give me teh projectz" forum.

Closing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Write code to parse this data and make a selection.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take a look at GraphicsEnvironment and GraphicsDevice. Toolkit has some limited info as well.

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

Perhaps you should

eEOF.printStackTrace()

and see what the stack trace has to say on it. Your custom error message isn't telling you much.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This doesn't work, the method isn't called. Any help or pointers are welcome!

What makes you think the method isn't being called? I would guess that it takes about 7 seconds for that whole method to finish - and it only updates the display after it's done.

If my guess is correct, read this thread from a couple of days ago: http://www.daniweb.com/forums/thread241390.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Thanks masijade.Still,not clear about this.
Say,test is a class which doesn't hav any parents.In such a case,why should i go specifically for runnable implementation instead Thread inherit.Pls,let me explain,the advantage of using runnable.

If there isn't any behavior of Thread that you need to alter by subclassing, why would you extend Thread? That's what they are saying here. If you can't point to an advantage in your code to extend Thread then you most likely have no reason to.

Keep in mind though, Runnable cannot return a value nor throw exceptions. If you need that functionality, use Callable.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't know. Why don't you add a few more println() statements to see how far you're getting in the program and where it's breaking down?

At the very least, post what you suspect the problem is. Help people help you instead of just asking "why doesn't this work".

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you need to retrieve info about the columns in the result set, you can get that with ResultSet.getMetaData(). The simpler way would be to just loop the result and append your column values with the String.valueOf( rs.getObject(index) ) with whatever delimiter you want to use.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You could use something like this for your listener

ActionListener radioListener = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        JRadioButton clickedButton = (JRadioButton)e.getSource();
        clickedButton.setBackground(Color.RED);
        if (clickedButton.isSelected()) {
            for (Enumeration<AbstractButton> buttons = bGroup.getElements(); buttons.hasMoreElements();) {
                AbstractButton b = buttons.nextElement();
                if (b != clickedButton) {
                    b.setEnabled(false);
                }
            }
        }
    }
};
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Here you have declared the type and size of the array

MovingPlatform[] platforms;
platforms = new MovingPlatform[1];

but you must still create an instance of each element

platforms[0] = new MovingPlatform();
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The computer makers themselves are pushing the consumer market towards the 64 bit environment faster as they compete with one another. Having more ram is a selling point and we're marching right past 4GB fairly quickly.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can go up to nearly 4GB with the 32-bit, so you still have room to nearly double your current ram before you would need 64-bit addressing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, if you actually behave like a civil member of the community on those other accounts, then I guess there really isn't any problem, is there? You used to know how to do that.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Keep it on topic please.

Josh, if you have an issue with a moderator action, you are welcome to discuss it with s.o.s..

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Closing this thread since you already started a new thread with additional information here: http://www.daniweb.com/forums/thread242344.html

Please do not create multiple threads for a single question.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The "turn" task can do whatever you need it to. Move one piece or one hundred. Just "disable" the player controls or whatever you do while the computer is taking its turn and when finished you return control to the player. The pieces under computer control can be kept in a list/queue/whatever and you just cycle through to move them. You don't really need separate threads for each move.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Here's a small example that may be of some help. I've commented the relevant sections

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class WorkThreadExample extends JFrame{

    JButton btnGo;
    JLabel output;

    public WorkThreadExample(){
        btnGo = new JButton("GO");
        btnGo.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                go();
            }
        });
        add(btnGo, BorderLayout.NORTH);

        output = new JLabel();
        add(output, BorderLayout.CENTER);

        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(200,200);
        setVisible(true);
    }

    /** called from button listener */
    private void go(){
        // start up a thread for our task and let the event queue get back to business
        Thread counter = new Thread(new CounterTask());
        counter.start();
        btnGo.setEnabled(false);
    }

    /** Small work task that we want to start from a UI event */
    class CounterTask implements Runnable{
        public void run() {
            try {
                for (int i = 0; i < 10; i++) {
                    final String countValue = String.valueOf(i);
                    // use this to put UI update tasks in the event queue
                    EventQueue.invokeLater(new Runnable() {
                        public void run() {
                            output.setText(countValue);
                        }
                    });
                    Thread.sleep(1000);
                }
                
                EventQueue.invokeLater(new Runnable() {
                    public void run() {
                        output.setText("Done");
                        btnGo.setEnabled(true);
                    }
                });
            } catch (InterruptedException ie) {
                Thread.currentThread().interrupt();
            }
        }
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                WorkThreadExample ex = new WorkThreadExample();
            }
        });
    }
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The problem is that all of that code is executing on (and holding up) the event queue, which is also responsible for repainting. You need to split that code off into a separate thread that calls for repaint() on the event queue when needed with EventQueue.invokeLater(Runnable) .

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The code fragment that you posted would only result in a single instance of the panel and should behave exactly as you want it to. The part I don't follow is that you say the panel is a class member of the frame, but you are making a frame.add() call. I thought this code was executing in the frame object, so what is frame ? If you can post the code it would clarify a bit.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, since it's difficult to see over your shoulder, perhaps you should post the current version of the code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you change the =="n" to equals("n") as Sciwizeh mentioned?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Thanks for the update. I was curious what the situation on that had turned out to be. I had figured on the user mode because in all cases the auto-ban came right after the set mode commands.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The time off work.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The code you posted won't compile - improper structure - which will certainly affect the visibility of those buttons.

You also haven't set howMany to any value.

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

It all depends on how they have things set up.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, I would imagine that your college would prefer that you at least did a little work on it yourself. They probably have some policies about that.

Edit: Hmm, yeah, they do: http://ctech.smccme.edu/Policies.html#Academic_Honesty_and_Plagiarism_

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It may be the "look and feel" you're using. The "Windows" L&F doesn't show the background color except for a tiny strip along the edge of the border, but "WindowsClassic" does show the background color.

try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you even bothered to start writing a "Friend" class yet? Started with a basic input loop perhaps? Or are you just sitting there waiting on someone to write all of this for you?

Your first post said it was urgent, yet 2 days later you haven't started? You may have read the rules about homework, but you certainly didn't understand them.

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

Well, sounds like you need to start learning Swing:
http://java.sun.com/docs/books/tutorial/uiswing/index.html

Post specific questions when you run into difficulties.

And use [code] [/code] tags. By 15 posts, you should know this.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Keep it on topic and leave the personal attacks at the door.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

"the instructor said that he knew for a fact that many schools admissions have access to a special type of Facebook admin rights where they can view profiles that are "locked" or "private"."
And I think that's a load of crap. School admissions do not have some magical override on privacy policies. I wouldn't have been able to take anything else the "instructor" said seriously after something like that.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Old German metal from my high school days: Helloween - I'm Alive
Drummer can really work the double bass :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Don't hijack threads with new questions. Start a new thread of your own.

And the answer to your second question is no.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Let's say your fares were in an array fares[3][] . Then your option group index directly corresponds to a fare schedule

selectedFare = fares[optionIndex];

No need for a switch. The rest of your code just references selectedFare[i] .

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The "test" array has nothing at all to do with your code. It's just an array I used to put some data in so you could see how to use the formatted output here

System.out.printf(" %s | %s | %s ",test[row],test[col]);

Each of those "%s" spots is just a place holder for a string value, which you specify in order after the format.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, that part is up to you. I think my example comes plenty close. Anything more is essentially doing that part of your assignment for you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ok congratulations, you've demonstrated that you can paste your homework. Do you have any specific questions? Anything at all to show that you have given this the least bit of thought?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hi guys,

I demand to know the correct order of the following topics to study

Object Oriented Design and Analysis, Design Patterns, and UML

Thanks in advance

[EL-Prince]

Learn manners first.

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

If you haven't specified a modifier and they are in a different package, they are private.

Use a public method getName() to get the name - don't access the variable directly.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just have an int[] array variable like "selectedFares[]" that points to the correct fare array. Your stateChanged method just needs to set it when they choose one, i.e.

switch (option) {
  case 0:
    selectedFares = fare;
    break;

case 1:
   selectedFares = fareo;
   break;

... etc
}

If your fares were in a 2D array, it would be even easier since the first parameter of the array could correspond to the index of your choice menu.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you have declared it private then you will need to use a public getter method to get the name. Same for balance.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You don't need a class name to call static methods within the same class - and that class name doesn't match anyway.

Also, make sure your method call matches the signature you wrote. You can't call a method that requires a String parameter without supplying a parameter.

'city1' shouldn't really be a parameter to the method. That is the value you want to send back from the method

return city1;

Re-read your class material on using methods.