Jean-francois Le Bas

+ Follow
since Aug 16, 2012
Merit badge: grant badges
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 Jean-francois Le Bas

Jean-francois Le Bas wrote:

Okay so to sum up :
i tried the three main methods of drawing in Java which are BufferStrategy, double Swing buffered image and simple swing with no image buffer.
And i found that the faster one is the last one (surprisingly).

Now I found that resizing the window to a small size makes the problem disappear. Don't laugh that's my problem and that's a total mystery.
here is a video of it : C41142775162.rar

what happens when i resize to a small size? i dunno. But if you know any help would be greatly appreciated.


11 years ago
i made a quick video to show you guys what it's doing

you can download it here : mov.rar

btw i still didn't get it working so if anyone has an answer, he is welcome.
11 years ago
hello Ranganathan

you can try this code:

and in your constructor :
11 years ago

as soon a i use gradients in my code, the repaint isn't done while resizing

i get something like that while resizing (black rectangles where it has been resized, see below). And when i stop resizing, everything is drawn again, but only then.

if i don't use g2d.setPaint(gradient); i have a quick redraw

i tried to repaint on resize, i tried to repaint when mouse is dragged but nothing.

thanks for help
11 years ago
thank you for your answer

you were right about timestamps
packet.getFormattedTimeStamp() give me 00:00:15,740
you were also right about the fact that each packet is a subtitle

the only problem is to get the subtitle end time. i tried :

none of them gave me the duration or end timecode

if you have any idea...

Xuggler (or Xuggle) is a great Audio/Video library for Java based on FFMpeg (so it can open almost everything existing on the planet)

As it is great, it has not a lot of documentation, specially for subtitles.

i was able to come with a bit of code that is supposed to read subtitles from a file

the only problem is that the text read is without the timecodes or the subtitle numbers as there is in SRT files:

i have this :

instead of this :

so this a problem and i really don't see where it comes from!

here is the code of the function I used:

To run the code you will need the Xuggler library available here : Xuggler 5.4
if the compiler says something about slf4j you will need that library too : slf4j
and here is a test file with a subtitle in it : title01_track3.mks

thanks for everything

okay so i found how to solve it

for people who are looking for an answer to the same question:

simply replace

and now everyting works! the labels are displayed, the buttons also and the big panel is finally scrollable!

i spent a lot of time looking for an answer but i never found this tip!
11 years ago
@Campbell Ritchie :

You have some peculiar naming there. Classes should start with capital letters.

okay i fixed this thanks for the notice. I will do this in the future now.

You are using the name of an existing class (JOptionPane) as part of a class which appears not to extend it.

it's just the name of the class. I called it that way because it look a little bit like a JOptionPane, nothing more

What on earth does myFrame = this; mean? That looks very very strange. You appear to be adding the dialog to itself.

it's just the same as typing simply: add(component) or this.add(component) but i prefer that way.

What sort of layout are you applying to the component you are adding the radio buttons to?

it's the standart layout the Flow Layout or do i have to specify a Layout?.

@Darryl Burke:

You shouldn't add(...) the panel (or any other component) to the scroll pane. For the correct approach, read the API for JScrollPane and follow the link to the tutorial on How to Use Scroll Panes.

okay so now i created the JScrollPane with passing the panel to the constructor but it's the same problem, nothing appears:

typical first-time poster - "I want an answer, and I want it now - bugger anyone wasting their time, not my problem"

don't think that way
since yesterday i tried to make the damn RadioButtons appears and it's a long time when you're doing only this.
that's why i neeed help. I didn't pass 5 min on it without looking for an answer.
i tried with no Layouts at all and i could show the radiobuttons but only when i pass the mouse over (strange!)
i tried every combination possible and looked over dozens of questions

so please if you can get this thing working, let me know. If you don't know, no problem.

And welcome to the Ranch


11 years ago

i created a component which extends a JDialog. It creates a JPanel (with a big size) inside a JScrollPane. Then i add RadioButtons and JLabels to the JPanel

two problems :
1 - the RadioButtons and JLabels don't show.
2 - the scrollBars of the JScrollPane don't show

here is my code :

thanks for your help
11 years ago