Alfonso Sanz

Ranch Hand
+ Follow
since Dec 19, 2015
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Alfonso Sanz

Dear all,

I am facing a problem raised with legacy code that I don't know what to do.

The issue is regarding  an app developed in java-swing. After several monts working on the app I have just spot it is consuming high amounts of CPU time when opening a PopupMenu based on JPopupMenu.
This Class belongs to a jar file wrapping the calls to JPopMenu. When opening that popup menu you see runing a top command that X process reaches 100% and java around 70%. The app stills looks fluent, but I was told to reduce the CPU consume. By contrast, running jconsole or jvisualvm the CPU is no more than 10%. Then... I don't understand what happens: why those high differences between top and jconsole; don't understand how to relate X process and java. Could be the rendering/ the mouse listeners? Why this Component take over the CPU and the rest of windows, the behaviour is correct?

By the way, the app is working over RHEL 7 and motif windows manager as desktop. One more thing: when trying to debug the app, eclipse stops at breakpoint and everthing freezes.

May you please give me some light to solve the problem?

Thanks in advance.
2 weeks ago
Thank you man!
4 months ago
Thanks for the answer Brian,

My question is already solved. The problem was I wasn't using transferable over the JList. My app  uses setTransferHandler().

I have no idea what IIRC is.

Thanks for your support.
4 months ago
Hi again!

Tested it! but it combine cells instead of headers.

Anyway. Probably the best idea is to use JLabels as headers making them sensitives to allow sorting.

Thank you a lot.
4 months ago
Thanks all,

Iwill hice It a try!!

Thanks you again
4 months ago
Hello Paul,

My current solution is working with headers with empty strings, but It does`t look very nice. My table is growing and shrinking dynamically and those empty headers doesn't look cool.

I have attached how it looks like,

I would like to implement one of thw solutions:

1) Combine all dynamically added headers in one
2) Hide/Remove the header fot those headers...

Thanks in advance.

4 months ago
Sorry Mr. Camick, but my idea is not to remove columns but only the header of some of my table columns instead

i have no idea if exists any method for doing or i need to implement my own headers by JFrames, that latter approach is not very accurate for me because I lose the capability of sorting.

Thanks again.
4 months ago
Hello guys,

i know is possible to hide the complete header locating a Jable out of JScrollpane.

My question is if is there any chance to hide only some column headers but not all or even combining them in just one colum (several but not all).

Thanks in advande.
4 months ago
Hello Folks,

I have a question.

In my old code I had a table and a big JPanel in which I had several little panels (like boxes) and I used drag and drop from Boxes to table and viceversa, but that scenario only allows me to drag one box at a time to the table (or other box -small JPanel-).
Then I have located my little Jframe boxes within a JList (and JList inside the first little boxes container, which is the big JFrame) in order to allow several boxes to be moved at a time.
My problem is that after placing the boxes inside the list, they are no more allowing me to be dragged nor dropped on.

Any suggestions?

Thanks in advance.
4 months ago
Thanks a lot... I will study both answers.
5 months ago
Thanks for the answer...

And cause a picture paints a thousand words... Imagine upon my table above filter is applied writing letter "S" and the result is...

that is... only words starting by "S" are located in a "stack" of 5 rows (original matrix 5x3) at first column and if more than 5 elements, sixth item goes to second column...

5 months ago
Hello Rob Camick,

thanks for the answer. I know that sigle colums solves the problem but that is not what I would like to implement. I suppose Y have a matrix and as soon as I filter, table is reducing by single cells.

Is just an idea.

5 months ago
Hello everybody,

I have a question about how to filter just cells and not entire rows. I mean... Imagin I have a table made of elements that are hierarchically the same: lets say Strings like I have attached.

I would like to filter just single Cells starting with a leter.

Any Idea?

Thanks a lot in advance.
5 months ago
Hello all,

Sorry for my dumb question , but I am currently blocked.
I have a question about JTable:

My JTable is composed by rows that I drag from the JTable and drop on a JFrame, once a row is dragged/dropped I want to avoid this row from being dragged again, but I have no idea about what to do.

Any clue?

Thanks in advance.
5 months ago