Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Refreshing a Window in Java

Name: HerkDerk !FpuBmVY37Q 2012-05-11 12:18

I'm using the JFreeChart library to draw charts in Java, blahblah...

I need the chart to draw on button click, how do I refresh the window without having to use setVisible(false) then setVisible(true)?

repaint() doesn't do shit.

Name: Anonymous 2012-05-11 12:21

Figured it out... invalidate() then validate() refreshes the window without any popping, blinking or niggering about.

</thread>

Name: Anonymous 2012-05-11 12:49

ok I lied, it's still gay...

how the hell do I get it to remove the chart element from the panel, re-add it and then re-draw it?

so I remove the chart from the panel, but then what? I've tried re-validating the panel, repainting the window, re-validating the window, etc. but the original chart won't gtfo

Name: Anonymous 2012-05-11 13:15

GC is shit.

Name: Anonymous 2012-05-11 13:25

>>4

I agree 100%, which is why I fucking hate Java. That said, I need to use it for this asshole class, and I can't figure this shit out.

You have to be kidding me, this is such shit. This doesn't even work:


            //Add new chart to panel & update window
            window.invalidate();
            window.remove(panel);     //Remove panel from window
            panel.remove(chartPanel); //Remove chart from panel
            panel.repaint();
            panel.add(chartPanel);    //Add new chart to panel
            window.add(panel);        //Add panel back to window
            window.validate();

Name: Anonymous 2012-05-11 13:28

figured it out, peace fags

Name: Anonymous 2012-05-11 15:40

>>5
If GC is why you hate Java, you haven't been using Java long enough. There are much, much better reasons to hate it.

Name: Anonymous 2012-05-11 16:12

>>4-5
fuck off and die you cock sucking faggots

Name: Anonymous 2012-05-11 17:10

>>7
Doesn't stop JVM's GC from being slow as fuck
That, and the horrible syntax, and the horrible API, and how it shoves OOP's in its shittiest down your throat.

Name: Anonymous 2012-05-11 21:35

>>9
Actually syntax is one of the cleanest. You might be bitching about semantics, which is what Java terribly fails at.

Name: bampu pantsu 2012-05-29 4:53

bampu pantsu

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List