Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Consider anchoring.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you bother to read any of the tutorials that mKorbel linked for you?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

i've put the exception ..............

No, you haven't.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can use JFileChooser for those things.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take a look through the tutorial on using tables and stop hijacking the OP's thread with your own questions.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I already solved it......

Yes, I am aware of that.

Pardon me for mentioning additional information that I though you might find useful. String matching error messages isn't really the most robust way to isolate the nature of error conditions.

mKorbel commented: i can't see reason for donw-voting +1 +8
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> I think I get why you have to put -x, because the Graphics2D scaled the "x" with -1 so it would be inverted, right?
Yes, with the entire transform inverted like that, the x value you pass to the method actually ends up being an offset to the left instead of to the right.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

To get it to actually render in the correct location, I also had to negate the x position in the super.paintIcon() call to account for the inverted scaling:

super.paintIcon(c, g2, -x, y);

@yancuoto: I would also recommend extending JComponent instead of Component and overriding paintComponent() unless you have to mix this with other heavyweight AWT components.

yancouto commented: Thank you man, you really helped me! +2
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take a look at the SQLException api. There are methods to get SQL State and the Error Code, which will often provide the specific info you're wanting.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's currently optimized for the key phases "Thanks for sharing" and "Do SEO to get backlinks to ur site."

jingda commented: Lol:) +0
Salem commented: LOL +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Quoted from the Snow Leopard EULA

"you are granted a limited non-exclusive license to install, use and run one (1) copy of the Apple Software on a single Apple-branded computer at a time. You agree not to install, use or run the Apple Software on any non-Apple-branded computer, or to enable others to do so."

Sorry, but discussions involving the deliberate violation of the EULA are not permitted on DaniWeb.

Thread closed.

jingda commented: I thought i reported the thread and it will get deleted. Seems i am wrong. lol +9
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, but the docs on using that service are very thin. I chose to point out the spelling difference because String-keyed locators like that do not provide much feedback for minor errors such as a key misspelling.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Perhaps you can begin by reading "Starting Python", prominently stickied at the the top of the forum, rather than hijacking someone's code snippet with off-topic questions.

Gribouillis commented: Good idea ! +13
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try using this for your cell renderer. You can pass it the combo box that you are using for the cell editor.

class CheckBoxCellRenderer implements TableCellRenderer {
        JComboBox combo;
        public CheckBoxCellRenderer(JComboBox comboBox) {
            this.combo = new JComboBox();
            for (int i=0; i<comboBox.getItemCount(); i++){
                combo.addItem(comboBox.getItemAt(i));
            }
        }
        public Component getTableCellRendererComponent(JTable jtable, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            combo.setSelectedItem(value);
            return combo;
        }
    }

On your table column, column.setCellRenderer(new CheckBoxCellRenderer(comboBox));

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Neil is actually lying to you. He is a spammer from Pakistan who only drops by to clutter up our forums with his signature link spam.

What Neil(and all of his other user names) just completely fails to learn after all this time is that Daniweb signatures are NOFOLLOW and they aren't even visible to search bots at all.

He is just wasting his time and ours and making a mess of the place. Personally I do not welcome him here.

(RoseMary3 may want to consider the info about sig spam as well.)

happygeek commented: well said, he might get bored eventually but I think he's too stupid to realise he has been rumbled +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

75.49810 miles = 121.502 km

Use 6367 in your formula instead of 3958.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you tried a different wav file?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, your homework is really not urgent to anyone but you.

Show what effort you have made to solve these yourself. Post your code and specific questions.

Cross-posted here and here

diafol commented: good spot +13
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Note that you are calling super.paintComponents(g); , not super.paintComponent(g); . That "s" makes a difference.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Something cool and hip like Pandora would definitely make the street credibility of MSFT go up for sure.
Or it would ruin Pandora.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The path to your database can be specified in your JDBC connection URL. See the following page about that: http://db.apache.org/derby/docs/10.8/devguide/

Examples are shown on this page

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> And when a guy goes around raising dead people, then is raised himself...well, that should cause us all to put some weight into what he said!
Definitely.

I always listen carefully to those who have risen from the dead.

You'll want to stand a little back from them when they're speaking, but you should listen very intently.

ddanbe commented: Also love the thing about your cat :) +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> You CAN know all this for sure. Ask God and he will reveal it to you.
Well, I asked my cat about it instead and he said I would never die so long as he needed feeding and that I would be rewarded eternally for this service.

I think he may be just making crap up to serve his own ends though.

diafol commented: Guffaws loudly :) +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> But I'm still reading, so there must be more to it than that.
Maybe not. Maybe it just starts repeating itself ;)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Much of that "free stuff" is pirated material and discussion of that is off the table here.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try using H2 or JavaDB instead. Both are embedded databases that do not need to be separately installed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

See How to Write a Key Listener. Check the key code and increment your positional variables based on that. Repaint as needed.

Be mindful about focus issue with key listeners. The listener will only receive events if that component has the focus.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

BigDecimal not work for you?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would recommend moving the table creation code out of conn() into your initUI() method.

Your action listener for the combo box then needs to initialize the table model if it is null or setQuery() with the new query string if the model has already been created.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No need to remove or create new JTables at all. Change the data that is within the model instead.

It looks like you can call setQuery() on your ResultSetTableModel to query a new set of data. If you maintain a single instance of that model, you can just update it's query when your combobox selection changes.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Look up the substring() method of the String class.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Perhaps JToggleButton will work for you. You can set separate images for icon, selected icon, disabled icon, etc.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Also, why not just put a boolean intersects(Ball) method on the ball class itself and check for intersection with another ball that is passed as a parameter to the method?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's just constructing a string "ipAddress" from the bytes in the packet using this String constructor: String(byte[] bytes, int offset, int length)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> You dont need to help if you dont want to ..
Or perhaps I could just delete the post altogether and issue a warning for violating the Keep It Organized rule:

Do provide evidence of having done some work yourself if posting questions from schoolwork assignments

If you want help here, demonstrate some effort. Don't just post assignments and expect others to give you the answers.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

(Edit: Wow, quite a coincidental cross-post. I was writing this when BitBlt posted... yeah, I was busy trying to do other stuff as well, so I'm slow...)

@kraai: I smoked for 23 years. Started around 15 and quit at 38. I tried quitting a few times, tried the gum, tried the patch, but never really committed to it enough. So I just kept smoking and occasionally would think, "Yeah, I really need to give this up some day".

It was during one of those times that I ran across some recommendations of a book by Alan Carr, "The Easy Way to Stop Smoking". There were a lot of positive reviews about it by people who said it really helped them quit. It was a pretty inexpensive book, so I figured it couldn't hurt to drop by the book store and check it out.

I ended up buying it and can honestly give that book the credit for my finally quitting. He does a really good job of showing you just how little you're getting out of it and how much you already know that. As a former smoker, he'd been though it all before and knew the mindset. He actually recommends that you keep smoking while you read the book, which makes it a much less daunting attempt at quitting.

I'll admit that I had to read it three times before I did finally bite the bullet and just quit, but that book did eventually get …

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ctrl-C, Ctrl-V

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There is example code in the tutorial that I linked.

mKorbel commented: just kidding +8
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

c.gridy = 55; You do realize that gridx and gridy are row and column index values and not pixels? Did you really want this component in column 56?

mKorbel commented: hmmm, right +7
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You have specified T is an Integer in your declaration

Tree<Integer> tree = new Tree<Integer>();

so item should be an Integer as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You were given four references. Did you read them at all?

Do you have anything more specific to ask than "plz help me"? If not, then perhaps the company does need someone else.

zachattack05 commented: I was thinking the same thing but didn't want to say it. +4
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to get those classes to the point you can even run them first. You have most of the code in "login" in your main() method. Obviously it won't even compile. And why have you declared them abstract?

I think you are way too far ahead of yourself with this. Learn basic Java fundamentals before you try to hack together Swing code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You resurrected this thread from the grave to ask others to correct some code you found on the internet and send it to you?

Amazing.

I don't think so.

Closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Many here are willing to help, but you have to put in the effort to work through the problems. You have to ask about specific things and post your progress as you work through the issues.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why should anything be done about him? I read through your thread there. You started acting like a jackass and your thread got closed. I don't see the problem as being on his side there.

Steve Nelson commented: | +0
Ancient Dragon commented: offset previous negative rep +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use JList.getSelectedIndices() to get all of the selected indices.
Edit: Cross-posted. Use html in your label to generate multiple lines.

sariberri commented: Thanks for replying :) +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Alright, thanks, but no thanks. You don't need to clutter up other peoples' threads with schizophrenic nonsense.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can add a break statement after found=true as well. There is no reason to keep looping once found.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

... we now return you to your regularly scheduled reality.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That's not a Java question, it's a SQL question. Look up how to use the LIKE condition.

Then you can refer the tutorials mKorbel posted above for questions about the UI.