Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Requesting links to pirated material is against the DaniWeb rules. Thread closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Start a new thread and post the relevant code or a small example that demonstrates the problem.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Megadeth - Tornado of Souls

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try GridLayout and yes, you'll probably need "some kind of loop" with JPanels or JLabels.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No worries, it may not have been clear at all to anyone else what I was getting at ;)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well yes... that would be the character that caused the problem I tried to point out to him yesterday. Evidently the OP didn't care enough to return to the thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your for() loop is not in a block. That code needs to be inside a constructor, method, or static initialization block.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You just need to keep track of the previous coordinates and update by the delta values

int prevX=0;
int prevY=0;

@Override
public void mousePressed(MouseEvent evt){
    prevX = evt.getXOnScreen();
    prevY = evt.getYOnScreen();
}

@Override
public void mouseDragged(MouseEvent evt)
{
    xPos = panel.getX() + evt.getXOnScreen() - prevX;
    yPos = panel.getY() + evt.getYOnScreen() - prevY;
    panel.setLocation(xPos, yPos);
    repaint();
    prevX = evt.getXOnScreen();
    prevY = evt.getYOnScreen();
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The original question had nothing to do with moving panels. He just wanted mouse coordinates.

Your example does show how to get those coordinates, so I guess some might find it helpful in that regard, but it's overly complex for just moving a panel. You can simply setLocation() on the panel and repaint() in your mouse listener. You don't need a timer at all and you don't need to keep adding the component to the container.

panel.setLocation(xPos, yPos);
repaint();

You also need to set the content pane's layout to null if you want to set the location manually.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Mercurial and Git are the current "favorites" in the open source VCS scene. SVN has somewhat fallen out of favor due to difficulties with merging branches.

We use SVN here and have no complaints, but we don't really branch and merge. If we were going to look into a new VCS, it would probably be Mercurial.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Key listeners are very touchy about component focus. You have to be sure that your panel is focusable and actually receives the focus. You can call panel.requestFocusInWindow() after you have made the frame visible.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The listener would be added your panel. You could also use KeyBindings: http://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

My problems with Java are two:
1) It's programs are big and slow.
2) And that I never took the immense time to fully learn the language.

#2 calls into question your qualification to claim #1.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

AndreRet has already pointed out the forum rules about showing some effort. Since you don't seem willing to show any, I'm closing this thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Both the OP and the hijacker need to read the forum rules about showing some effort if they want help with homework. This is not a homework completion service.

Thread closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You do realize what e.getSource() returns? Read the method description again, because changing it to what you did makes no sense at all.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to show some effort if asking for homework help. Post your current code and specific questions.

If you don't know what a float data type is, you need to read your book or a basic Java tutorial.

stultuske commented: no good work without a solid basis indeed .. +12
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Another option is Setting up a private WoW game server, Upload your game server to a host. Get your friends and friends of friends into the game. Check ingame lag against connection speed. Find the corelationship and tweak accordingly. So far private game servers have been hosted without much scientific research into the networking issues. This is as good a time as any to do an academic study on the matter.

Which is a violation of the EULA and is technically illegal.

mani-hellboy commented: keep it up to find calprits +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ok, well there is the problem: Java 1.4.2

Auto-boxing was introduced in 1.5. Without auto-boxing, the compiler doesn't convert primitive variables to their object wrappers, like Integer, automatically. You have to create those object instances yourself: new Integer(yourInt) Java 1.5 was officially at End-of-life status in 2009. You (meaning your class most likely) need to use a version of Java that is still supported. There is absolutely no reason at all to still be teaching students with anything prior to Java 1.5. Java 6.0 has been out since 2005.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

What are you using to compile the program and which version of Java? That should resolve just fine to putClientProperty(Object,Object).

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The Java 1.4.2 docs do seem to come up near the top of search results fairly often, so it's an easy mistake to make if you don't glance at the version.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Cross-posted here: http://www.daniweb.com/web-development/databases/ms-sql/threads/407231/1738343#post1738343

Please direct any further discussion to that thread. Closing this one.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This is really not a difficult problem

pButtonarray [x] [row].putClientProperty("x",x);
pButtonarray [x] [row].putClientProperty("row",row);
pButtonarray [x] [row].addActionListener (this);
public void actionPerformed(ActionEvent e) {
    JButton btn = (JButton)e.getSource();
    System.out.println("clicked x " + btn.getClientProperty("x") 
       + ",row " + btn.getClientProperty("row"));
}
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@mKorbel: I think the OP could go either way just fine. For more complex behaviors like your example of changing state on mouse events along with holding the data values, the inner class works well. For just attaching a couple of extra data values to a JButton, putClientProperty() is very handy and simple.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

putClientProperty(java.lang.Object,java.lang.Object) is just a key-value pair mapping. Strings are often used for the key values, but they don't have to be. You can use any Object as a key, which allows for some pretty clever mapping schemes in some cases.

In your case, strings would be fine: setClientProperty("row", row) This would set an Integer value of row with a key named "row".

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

There are no daily limits to the number of simple up/down votes by clicking the arrows, but you can only add reputation to a particular user once per day.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Moving to mySql forum.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As James said, you can associated various information with the buttons by setting property values on them.

There are also other ways to associate various actions with the buttons, but we can't really give you specific suggestions because you still have never said what you need to do when the button is clicked. All you will say is "I need to know which button is clicked". Well, you've been told the answer to that. Obviously, you need to do something else with that information, but if you won't explain further then no one can help much more.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This appears to be a duplicate of your other thread: http://www.daniweb.com/web-development/php/threads/407445/1739310#post1739310

Closing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

MouseEvent.getSource() returns the Object that was clicked. You can cast that to object to JButton.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Then the getSource() method on the mouse event will tell you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Most likely the loops are unnecessary. Depending on what the OP needs to do when the button is clicked, there are many ways to attach data or specific actions to a button.

More info is needed about the intent of the buttons.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Agreed. Thread closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to ask specific questions about the parts you are having trouble with.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

^^ What he said.

Post specific questions if you have them. The forum rules state that you must demonstrate some effort if you want help with homework assignments.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes i do understand Ezzaral, thats why i showed the three possibilities to call the class without getting an error or null pointer.

But you added those in an edit after I posted ;)

I didn't say your original post was wrong. He can certain make it work by changing the method to static. I just pointed out that it may not apply if he was trying to use objects and methods.

You did however give him three solutions to the program without having to think about correcting anything at all himself.

@boris: Glad you resolved your errors.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That completely depends on whether the OP intends to write the program in an object-oriented manner or a procedural manner.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Null pointer exceptions occur when you try to call a method on an object that is null. Try to determine why that is happening in your code.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take care to use the correct operator. '==' is for comparison.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Read the forum rules:
- Do provide evidence of having done some work yourself if posting questions from assignments.

Thread closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Im not a techy, nor do I pretend to be, I really need a kind person who will put the problem into a java application. )

Im a girl in desperation !

You're also a girl violating the forum rule about showing effort if you expect help with homework assigments.

If you can't show that you have made the slightest effort yourself, this thread will be closed. Post code, psuedocode, or at least specific questions that might indicate you are anything other than another lazy student wanting others to do their assignment for them.

Ball is in your court.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Look up JFreechart.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You are still asking for help hacking though, which is not allowed within the forum rules.

Thread closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

My response was specifically regarding the question of some banned accounts not appearing to have some of the more evident tell-tale signs of spammer accounts. Many of the spammer accounts do display those highly visible patterns, but mods and admins are privy to a bit more info that can identify spammers that may not be evident from the data that regular users can view.

I can't really address the issue of those accounts appearing on activity lists, because that involves development changes to the workings of the forums themselves and the metrics those lists display.

I can say yes, there are still a ton of spammers trying to post their garbage here and some of the things those accounts do still affect rankings like activity points. While it's unfortunate that such ranking lists may be affected, the main aim of the mods is to ensure that those spammers do not affect the functioning of the forums for the users.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Are you running a 64-bit JVM trying to connect to a 32-bit Access installation?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You really only need the "%.2f" part. You can read all about the formatting options here: http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can use the String.format() method to apply those formats.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Mods and admins can see a bit more information and after dealing with this spam wave for two months, certain patterns are quite evident.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sure, you could probably have thousands without an issue. It depends on how much memory you allow the VM to take and the size of your objects, but 100 certainly won't be a problem.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It sounds to me like he just wants you to save them in memory in an array.