Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Perhaps no one has any useful recommendations for you?

I found this with a quick search, but I don't know a thing about it.

It's a rather esoteric request that you've made, so you can't necessarily assume that people are simply ignoring your post. Most probably just don't have the information you're seeking.

peter_budo commented: Interesting result +16
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> How does the fist one way works? How could JLabel maintain a reference to an another object?

class LinkedLabel extends JLabel{
    Object linkedObject;
    
    public LinkedLabel(Object linkedObject) {
        this.linkedObject = linkedObject;
    }

    public Object getLinkedObject() {
        return linkedObject;
    }
}

You can then cast e.getSource() to LinkedObject in your listener to retrieve the linked object.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

And that is the reason I linked the tutorial. You need to add those items to the table model, which can be a DefaultTableModel or one of your own creation.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Start with this.

When you have some basics in place, post back with your code and specific questions about the parts that are giving you trouble.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

A few possibilities:
You could extend JLabel to maintain a reference to the object, in which case the listener could retrieve it directly from the clicked label.
You could create a listener that keeps a reference to the object and create a new instance for each JLabel.
You could use a Map to store the label to object mappings.

mKorbel commented: still don't undestand OP's reason +1 +9
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't see where you specify the table name anywhere in that function, just the column.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

First, I would recommend fixing your indentation in the posted code fragment. People are more willing to read well-formatted code.

Second, I would check the procedure itself. Sounds like it's unhappy about an aggregate function or group clause.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ask specific questions if you have them. Show some effort.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you tried adding a forward slash before the folder name when the directory is located within your src directory? i.e. getResource("/Cursors/Cursor_Black.png") This is purely a pathing problem that you need to figure out with your build environment.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That's because you probably didn't specify that the images directory was to be copied into the jar when it was built. If you place it under 'src' then it will probably be included by default.

Your IDE project classpath is not necessarily the same as your jarred application.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you place it under src then it will probably automatically be on your project's classpath. I don't use Eclipse, so I can't verify that for you though.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If your "Cursors" directory is not under your source folder, you may need to add that to your classpath as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you have specific questions, ask them. Your post is too general.

Read the Zend docs and search Google if you are needing basic Hello World tutorials for this.

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

Please post specific questions about what you are having trouble with.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This thread was from 2008 and was only resurrected by someone promoting their blog. That post has been deleted and I am closing this thread to prevent any further confusion.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to read up on what a recursive function is. That isn't what you wrote/found/copied there.

I'm also wondering how closely you've looked at your outputs, given this particular line in your function

return s;
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

What are you referring to? There is no "CorrelationException" in the API.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Pass by reference- pass class Object.
Nope, try again. Object reference is still passed by value. Google it, there are plenty of explanations about.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> GlassFish is not apache's server. It is from Oracle.
And your point? Both are open source application servers that he could try.

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

From the groups page, you should have an option at the bottom to Create A New Group.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

New thread posted here. Closing this one.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Not really sure why you would want to set the balance in a method called "setyear". Does that seem logical to you?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use the unicode value, i.e. '\u00ae' to match ®.

You can look up the unicode value for others as needed

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you bother to read any of the sticky thread at the top of the forum?

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

Glad it worked out.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Turns out it was just a couple of very clever kids fooling around.

Gee. Who would have guessed? I mean, government conspiracy seemed so much more likely...
:icon_rolleyes:

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just don't install your custom renderer for that column. Since you're iterating all of the columns in the model and adding it, just skip the first one.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It states Unclosed String Literal. Check your String array initialization.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I told you explicitly: update "previousX" in your listener.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Anyways I'm using Netbeans and it doesn't allow me to modify the declaration of my variables.(or I don't know how to)

You can customize the create/initialization code for components added through the designer by selecting the component and then selecting the "Code" tab in the Properties window. To override a method, you would add your code to the "Custom Creation Code" property.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

paintComponent() should just be used to render graphics based on current state. You should avoid changing variables in that method. Update your variables externally in some other method and then call repaint() to render the update.

In your case, that would entail moving the code that changes previousX into your action listeners before repainting.

Edit: Note that I didn't actually run your code or study it in detail. This is just a general suggestion based on a quick glance.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you actually installed any implementations of the API? See this thread.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@mKorbel: Interesting link. Thanks for posting that, as I hadn't run across that way of doing it before.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to set it back to the normal default colors if the highlight condition is false.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'd also recommend reading through a few of these basic tutorials on working with objects: http://java.about.com/od/workingwithobjects/Working_With_Objects.htm

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I think the Graphics And Multimedia forum may be your best bet for this. I'll move it over for you.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I can't say for certain which character your file is actually using for the line break. A direct copy of your text above pasted into Word seems to have "vertical tab" (chr(11)) characters at the end of the lines.

Those can be replaced with the following loop

For i = 1 To ActiveDocument.Paragraphs.Count
    ActiveDocument.Paragraphs(i).Range.Text = Replace(ActiveDocument.Paragraphs(i).Range.Text, Chr(11), " ")
Next i

Those may not be the same characters coming in with your actual file though because copying and pasting into Word can vary depending on the copy source.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

In the for..each loop. Each paragraph is concatenated into 'str'. 'para.Range.Text' is the text of the current paragraph, in which I am replacing the carriage returns with a single space before I add it to the string.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This code fragment worked for me on the paragraph that you posted. I seldom use VBA for anything either, so my knowledge of it is pretty limited. I'm just hacking something together here

Dim str As String
Dim para As Paragraph
For Each para In ActiveDocument.Paragraphs
    str = str & Replace(para.Range.Text, vbCr, " ")
Next para
ActiveDocument.Range.Text = str
End Sub

Word was treating every line as a paragraph when I opened your text from a simple text file, so I had to concatenate them together to form the single string. Your file may or may not contain vbCR or vbCrLf ofr the line breaks. You'll have to determine that for yourself by examination.

Perhaps someone else more versed in VBA in Word will chime in with some further advice.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The function I posted above replaces carriage return line feeds (CrLf) with a single space. The [yourStringHere] part should be whatever variable you use to hold that entire paragraph string.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you tried using Replace([yourStringHere], vbCrLf, " ") against the entire string?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Moving to the Java forum. I think you'll get better response there.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Should ProductoID + 1 instead be ProductID + 1 ?
(Note extra 'o')

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> If it is only a handful of times, what does it hurt having it and not using it?
Because any extra feature/button adds an element of confusion (& frustration) for everyone who doesn't know what it is or how to use it.

Tooltips can go a long way towards mitigating that confusion.

WaltP commented: Seems that's what they are for, so why not? With an option to turn them off... +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can use any means you wish to load and save the elements with a DefaultListModel. You aren't limited to an array for that.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Start with the MySQL documentation on using their JDBC driver. They have several examples to get you started.

Edit: Cross-posted with Slimmy. Be sure to check the link he posted as well for a more general tutorial on JDBC.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Perhaps answering more recent threads would be more helpful? Pulling old threads like this back up to the top just causes confusion for everyone.

Closing.