Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you simply search on "i_m_rude" you will have all the posts to peruse at your leisure.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Start checking braces. You have an unclosed block above your keyReleased() function declaration.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I think you are looking for SSCCE?

FALL3N commented: answered question +2
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You should not have a repaint() call in your paint() method. Also, you should really be overridding paintComponent() on a JPanel or something instead of paint() on a JFrame. If you really must override paint, make sure you call super.paint() first or other components in the frame won't render correctly.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sure, you can connect to MySQL with JDBC. MySQL has info on their site: http://dev.mysql.com/usingmysql/java/

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Since you've moved the origin to the middle of where you want the rectangle, draw the rectangle centered about the new origin.

Old rect:

g2d.drawRect(100,100,10,10);

translating to center of rect and drawing the same shape:

g2d.translate(105,105);
g2d.drawRect(-5,-5,10,10);
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you translate your origin to where you want the center of the rectangle to be, are you drawing the rectangle relative to the new origin location?

If you have a rectangle centered at say (2,2) and you translate to that point and draw the rectangle with the same (x,y) values, you will now have a rectangle centered at (4,4) because you have shifted the entire coordinate system to a new location.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You are basically undoing your translation on line 7 by restoring the original transform. You are rotating the original context.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It works just like any other Java library. Perhaps you can install a player bean in Netbeans, I don't know, but really it's just an API. Use it like any other API.

Read the extensive docs if you're unsure of how to work with it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try the Java Media Framework

There is one example of using it with Swing here in the code samples section.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use H2 for your database. Problem solved.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you do find you need an installer, take a look at IzPack.

tux4life commented: Sounds interesting. +13
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Because you seem unable to make your point without including intentionally offensive language.

If you could act like an adult, perhaps your feedback would be taken seriously by others.

Nick Evan commented: Bam! +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Step one is Google.
Step two is trying on your own.
Step three is asking specific questions about the things you are having trouble with.

tux4life commented: IllegalStateException :D +13
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, I can. Solved is solved and you stated it to be so.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You might take a look at the transform() and inverseTransform() methods on AffineTransform.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, if you wish to discuss a particular question, please confine it to a single thread so that the answers don't get spread around all over the place.

Closing this thread. Please direct further discussion to the thread linked above by JorgeM.

JorgeM commented: thanks! +8
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@diceadmin: Then why are you bothering to post here on an open discussion board? These forums aren't here to collect private business.

If the questions and answers cannot be openly shared, they don't belong here at all.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It's a good thing that this thread isn't entitled "Coherent Thoughts of the Day".

codeorder commented: a.google.defined:coherent Returned "yum":) +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you've written that program 500 times, you're doing it wrong.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I guess that depends on what you intend the behavior "kick something out" to mean. Does it bounce backward? Slide sideways? Pop out on the other side?

If you maintain a directional vector of any kind or separate x,y velocities, then you can determine the resulting position based upon the vector of incidence and whatever rules you decide for the outcome as I mentioned above.

You just need to examine the state at the time of collision. If you aren't saving it in a way that allows that, you may need to alter your objects to keep that information handy.

DavidKroukamp commented: helpful and concise +8
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

In Java, you can use the JOGL bindings for OpenGL. There are some basic tutorials on their project site and then you can move on to the NeHe OpenGL tutorials.

The OpenGL red book is a good reference to keep handy.

The JOGL bindings are just wrappers around the OpenGL API, so if you switch to C++ later the differences would be minimal (ie pointers instead of references).

You may also find this information on The Mathematics of the 3D Rotation Matrix helpful if you're not already familiar with rotation matrices.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Do not make multiple threads for a single question. Closing this one. Please continue working through the original thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The API doc on ResultSet says getRow() is optionally supported on forward-only result sets. Sounds like your JDBC driver opted to not support it.

Try creating your statement to be scrollable

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And
3) Learn to indent.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Agreed. Let's keep further discussion in a single thread:
http://www.daniweb.com/software-development/java/threads/411255

Closing this one.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

What on earth are you trying to do with this code?

new PeerLogin.2(this)
DavidKroukamp commented: lmfao +8
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Put a blank label placeholder in your UI where you want the picture displayed. When the guess is wrong, use the JLabel.setIcon() method to put the correct picture in the label.

Helpful tutorial: How to use icons

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Components placed in BorderLayout.CENTER expand to fill the available space in the container.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Is there a reason not to just use JInternalFrames for this? It seems that is what you're trying to mimic.

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

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

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

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

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

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

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

Look up JFreechart.

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

Why not use Google instead of expecting others to do it for you?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you wish to access the method without an instance of your WordRepeater class, you will need to declare the tester method 'static'.

public static boolean tester (...
Genericusername commented: Prompt, Helpful, and Concise +1
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why did I write this in bold?

codeorder commented: "just.because"?xD +0
BitBlt commented: It tricks us into thinking it's profound. +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'm not seeing any reason to even have the ArrayList at all. You can add and remove nodes directly on the tree model.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can only add nodes to other nodes, which you do through the TreeModel. The JTree component does not have an add(Node) method.

http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Please note the forum rule regarding effort and school assignments:
- Do provide evidence of having done some work yourself if posting questions from assignments.

Post your code and specific questions about the issues you are having trouble with.