• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPanes is writing in each others field

Jimmy Nilsson
Posts: 26
  • Mark post as helpful
  • send pies
  • 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?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic