• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

JPanes is writing in each others field

Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey, i got a problem!

I have one class:
public class DocumentFrame extends JInternalFrame implements ActionListener

this class holds newdoc and olddoc

In the contructer its creates a object of an internal class:
public class drawPanel extends javax.swing.JPanel implements AdjustmentListener

this internal class overrides the JPane Paint method and draws the New doc by hand.

In main i have the folowing code:
_documentSplitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, _documentNewFrame, _documentOldFrame);

bouth the newFrame and the OldFrame contain NEW doc and OLD DOC, but in _documentNewFrame the New doc is the master(the real new doc) and in _documentOldFrame the New doc is the slave(the old doc).

i also have the following code to add them to screen:
_treedocSplitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, _tabbedframe, _documentSplitpane);


and then i add the treedocSplitpane to the Window.

This works almost perfect, there is a problem i cant solve.

When open the window the master(_documentNewFrame) is drawing its doc to the left and the slave((_documentoldFrame) is drawing to the right.

This looks good, but when running on a XWindow with slo update i notice that thay switches places to draw in? documentoldFrame is drawing to the left and so on? when loading the docs it looks good but when scrooling thay are jumping from drawing in the left to the right and so on. The result is not looking to good.

Shold not this deside where it shold be drawing?
_documentSplitpane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, _documentNewFrame, _documentOldFrame);

Hope you understand it?

There's a hole in the bucket, dear Liza, dear Liza, a hole in the bucket, dear liza, a tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic