Chaz Branham

Ranch Hand
+ Follow
since Apr 04, 2013
Chaz likes ...
Eclipse IDE Java
Merit badge: grant badges
Just an intermediate programmer trying to help and learn.
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Chaz Branham

Ok found my answer here on the forums. Below is the link that answers the questions just in case anyone is interested.

Answers to my question.
Ok very weird... I right clicked the project and selected Clean and everything starting working again? Can anyone explain what that does or means?

Good day all,

Very frustrated with this one... I was simply typing in a JOptionPane message box then all the sudden the two singleton classes I created and use in quite a few areas are marked as errors in my whole project? I removed the JOptionPane and it still says the errors everywhere in all my classes...

It's almost like it can't see it in the package. Some of the classes that use them are in the same package and they show error's as well.

I don't know what to do to fix this but I have a deadline in two day's to get something working out and I cannot with this. I have compiled and used it several several times and everything was fine so I dunno what is going on.

Any help would be appreciated.


Edit 1:
Ok so it's not just the singleton's any of the classes that I have in other packages that I am calling from other packages are also doing the same thing:


These are also error's shown and I didn't change anything that should have done all this...
Great explination and thank you for taking the time in guideing me in the right direction when testing and trying to find the problem areas. I will in the future plan to do this with any recommendations I recieve.

Have a good one
9 years ago
I did try your two line solution and when I used that it never went to the next component and just inserted a tab into the JTextPane so then I wrote the code mentioned earlier to get it to work. I'm not sure what the differences are but the two line solution did not resolve the issue.
9 years ago
Here is what I came up with after reading your recommendation:

This works like a champ but is it the right way? I still needed to use the KeyboardFocusManager and call the focusNextComponent method.

9 years ago
Thank you for your help and recommendation.
9 years ago
Disregard the question. It was simple I just needed to consume the event with my key listener so it stops inserting the tab into the JTextPane.

9 years ago
Good Day All,

This may be something simple but I cannot seem to figure out how to make the tab key stop tabbing (ie. putting spaces) inside of a JTextPane. I do have it tabbing to the other componenets by setting up a FocusPolicy class and FocusPolicy Keys but it still adds the space in the JTextPane even though it tabs out.

Any help on this is greatly apprecaited.
9 years ago
Ahhh I think it has something to do with your following line:

I didn't know of TransferSupport. I bet that has some key to play with getting the object but I'll have to do some research. Thanks for the example.
10 years ago
Paul, not to sound like an idiot but is that not what I did with the following code or did I miss something?:

10 years ago
Tony. Thank you for your response as that is what I thought I could have done with the DND library but since I am a beginner (even though I have went through every tutorial I could find) it has eluded me. For example:

This code is located in the drop method of the recieving JPanel.

And the code for the Person being dragged I used the following to create the DataFlavor:

It would execute without errors which I was happy about but the person object created from the dataflavor was always a new person as I believe from the following line did that:

So after a very long time I decided that it was too restrictive to do what I needed which was probably the wrong decision but I had nothing else to go on. I wished I could have found a good example or something simalier that would just transfer a component using dnd instead of just creating a new one each time. There may be something like that out there but I could not find it.

Paul I would love to if I understood what your talking about. I'm not sure how to accomplish that.

Thanks again everyone and I know a lot of folks are probably shaking their heads at me but I really want to understand it.
10 years ago
Thanks all for the replies. I was able to achive what I wanted by removing all of the components and re-adding them back to the same JPanel then calling revalidate() made it work very nicely. I will experiment with the setconstraints as that sounds like a cleaner way of doing this.
10 years ago
Good Day all!

Can anyone explain or point me in the right direction of how to change the location of a grid bag positioned component after it's already been added to the layout earlier?

Example is if I want component 1 to change from row 1 to row 2.

Thank you for your help and time,
10 years ago
Tony I apologies if I had not been clear with my goal. I am (trying) to write a manning tool to visually assign personnel to work. I need it to be drag and drop oriented instead of a data entry screen. The overall goal is when you drag a person and drop them somewhere it will put the person there and make the change in the database so reports and other items can be ran off of that data.

So the tool is just an interface for meeting needs by assigning personnel and keeping track of those changes and assignments.

Does that make sense? Is that what you were asking about?
10 years ago