paperless
asked on
Dragging JScrollPane problem.
HI !
In my GUI aplication, I have divided my GUI into two part using JSplitPane. on left have a JTree an on right side have JTabbedPanel's .
Dragging scrollpane to right side is a prblem if the Panel where I have used Boxes.
How to solve the problem.
take care
In my GUI aplication, I have divided my GUI into two part using JSplitPane. on left have a JTree an on right side have JTabbedPanel's .
Dragging scrollpane to right side is a prblem if the Panel where I have used Boxes.
How to solve the problem.
take care
ASKER
yA BUT I will grade it if get proper answer..
see the question and evaluate the answer............
its open for I can still grade them provided u are satisfied by the expectation and the answer I got..
take care
paperless
see the question and evaluate the answer............
its open for I can still grade them provided u are satisfied by the expectation and the answer I got..
take care
paperless
If your not satisfied with the answer then why aren't you asking clarifying questions.
In some case, experts have asked u for clarification of the problem and you haven't replied.
In some case, experts have asked u for clarification of the problem and you haven't replied.
dear paperless:
Usually if you aren't satisfied with the answers just ask again in the same thread and tell why you aren't satisfied. In extreme cases when nobody cares to answer your question, you can have your question deleted by the Community Support and get back the points.
It is bad style not to accept any comment as an answer just because you weren't satisfied. Experts want feedback whether their answer are good or not. In the long term you should close all questions because the experts can look at your profile and decide that they don't want to help you because you don't close your questions.
What to do now? Go to your own profile and close all open questions one by one.
Usually if you aren't satisfied with the answers just ask again in the same thread and tell why you aren't satisfied. In extreme cases when nobody cares to answer your question, you can have your question deleted by the Community Support and get back the points.
It is bad style not to accept any comment as an answer just because you weren't satisfied. Experts want feedback whether their answer are good or not. In the long term you should close all questions because the experts can look at your profile and decide that they don't want to help you because you don't close your questions.
What to do now? Go to your own profile and close all open questions one by one.
ASKER
Ok thanks for reminding me to do my home work first.
Let me first reply properly to earlier questions openend by me.
and then I come back to this one.
take care,
paperless
ASKER
Hi !
So now you guys can start answering the answerws to my problem now, that I have cleared all pendings???
So now you guys can start answering the answerws to my problem now, that I have cleared all pendings???
objects and dnoelpp are cruel :-) As a result of this disscusion I got two "Good answer" notifications by paperless!!! Poor paperless!
Why I(anyone) need these expert points by the way?
So, In my opinion you have component with setMinimumSize(new Dimension(some big value,some)) in your right side Panel....
Regards to all participants in this question!!!
Especially to objects! :-)
Best Regards,
Valeri
Why I(anyone) need these expert points by the way?
So, In my opinion you have component with setMinimumSize(new Dimension(some big value,some)) in your right side Panel....
Regards to all participants in this question!!!
Especially to objects! :-)
Best Regards,
Valeri
I don't understand how you have divided your GUI with a JScrollPane.
Can u pls explain?
Can u pls explain?
ASKER
HI !
Valeri you mean to suggest I put setMinimumSize(), to the right Panels or ??
I have devided like this oh sorry I have used JSplitPane to devide it vertically .
sorry for inconvenience........
take care
Valeri you mean to suggest I put setMinimumSize(), to the right Panels or ??
I have devided like this oh sorry I have used JSplitPane to devide it vertically .
sorry for inconvenience........
take care
So what exactly is the problem with the ScrollPane?
ASKER
I have put up both panels into JScrollPane.
At some point I have dragged he right panel towardss leftt. for proper view .
NOw I want the proper view of left side so I try to drag it righ now. But because in the right Panel I have used Boxes and GridLayout, this is now able to do.
and thouh right side tree is in JScrollPAne but for proper view I need to drag it right.
At some point I have dragged he right panel towardss leftt. for proper view .
NOw I want the proper view of left side so I try to drag it righ now. But because in the right Panel I have used Boxes and GridLayout, this is now able to do.
and thouh right side tree is in JScrollPAne but for proper view I need to drag it right.
ASKER
I have put up both panels into JScrollPane.
At some point I have dragged he right panel towardss leftt. for proper view .
NOw I want the proper view of left side so I try to drag it righ now. But because in the right Panel I have used Boxes and GridLayout, this is now able to do.
and thouh right side tree is in JScrollPAne but for proper view I need to drag it right.
At some point I have dragged he right panel towardss leftt. for proper view .
NOw I want the proper view of left side so I try to drag it righ now. But because in the right Panel I have used Boxes and GridLayout, this is now able to do.
and thouh right side tree is in JScrollPAne but for proper view I need to drag it right.
So your problem is with the layout of your components on the right side?
ASKER
Ya, and because of this loosing flexibility in movement.
So if user wants to move Panes right or left its problem.
So if user wants to move Panes right or left its problem.
Well can you post your layout code?
Yes... Some of your components(in the right pane) must have setMaximumSize(new Dimension(x, y)); or setPreferredSize(new Dimension(x, y));
Take a look at the biger components and make them smaller... Do it in your Init() function.
I hope it will help you!!!
Can you post your layout code?
Best Regards,
Valeri
Take a look at the biger components and make them smaller... Do it in your Init() function.
I hope it will help you!!!
Can you post your layout code?
Best Regards,
Valeri
ASKER
Layout of Panel ?? wich is causing problem ??
private void createMailPane(){
JPanel mailSelPane = new JPanel(new GridLayout(3, 2, 0, 20));
mailSelPane.setBorder(new TitledBorder
(new LineBorder(Color.black), "Event Notification" ));
JLabel jLab = new JLabel( " Enter Mobile No.");
// textVal = "Don't change this text if SMTP IP is"+
// "valid in config file";
tF = new JTextField();
tF.setText("Not Available In This Version!!");
// tF.setText("");
tF.setEditable(false);
JLabel jLabs = new JLabel(" Enter E-Mail Id");
tFs = new JTextField();
JLabel pagerLabs = new JLabel(" Enter Pager No.");
JTextField pagerText = new JTextField();
pagerText.setText("Not Available In This Version!!");
// pagerText.setText("");
pagerText.setEditable(fals e);
mailSelPane.add(jLabs);
mailSelPane.add(tFs);
mailSelPane.add(jLab);//, BorderLayout.NORTH);
mailSelPane.add(tF);
mailSelPane.add(pagerLabs) ;
mailSelPane.add(pagerText) ;
JPanel eventPane = new JPanel(new GridLayout(5, 2));
eventPane.setBorder(new TitledBorder
(new LineBorder(Color.black), "Events" ));
Box nodeBox = Box.createHorizontalBox();
mail = new JCheckBox(" ");
JCheckBox sms = new JCheckBox( " ");
sms.setEnabled(false);
JCheckBox pager = new JCheckBox(" ");
pager.setEnabled(false);
nodeBox.add(mail);
nodeBox.add(sms);
nodeBox.add(pager);
Box ccmBox = Box.createHorizontalBox();
//JCheckBox
ccmmail = new JCheckBox(" ");
JCheckBox ccmsms = new JCheckBox( " ");
ccmsms.setEnabled(false);
JCheckBox ccmpager = new JCheckBox(" ");
ccmpager.setEnabled(false) ;
ccmBox.add(ccmmail);
ccmBox.add(ccmsms);
ccmBox.add(ccmpager);
Box logBox = Box.createHorizontalBox();
JCheckBox logmail = new JCheckBox(" ");
logmail.setEnabled(false);
JCheckBox logsms = new JCheckBox( " ");
logsms.setEnabled(false);
JCheckBox logpager = new JCheckBox(" ");
logpager.setEnabled(false) ;
logBox.add(logmail);
logBox.add(logsms);
logBox.add(logpager);
Box reBox = Box.createHorizontalBox();
JCheckBox remail = new JCheckBox(" ");
remail.setEnabled(false);
JCheckBox resms = new JCheckBox( " ");
resms.setEnabled(false);
JCheckBox repager = new JCheckBox(" ");
repager.setEnabled(false);
reBox.add(remail);
reBox.add(resms);
reBox.add(repager);
nodeO = new JCheckBox("Ovent");
nodeO.addItemListener(new NodeCheckBoxListener());
instO = new JCheckBox("Event");
instO.addItemListener(new InstCheckBoxListener());
restartO = new JCheckBox(" Exceeds (Not Avail!)");
restartO.setEnabled(false) ;
restartO.addItemListener(n ew RestartCheckBoxListener()) ;
logSizeExceedO = new JCheckBox("Message");
logSizeExceedO.setEnabled( false);
logSizeExceedO.addItemList ener(new LogCheckBoxListener());
Box evtBox = Box.createHorizontalBox();
Box typeBox = Box.createHorizontalBox();
JLabel eventNot = new JLabel("Event Available to subscribe");
JLabel mailLabel = new JLabel("Get Mail ");
JLabel pagerLabel = new JLabel("Get Pagerbeep ");
JLabel smsLabel = new JLabel(" SMS");
evtBox.add(eventNot);
typeBox.add(mailLabel);
typeBox.add(pagerLabel);
typeBox.add(smsLabel);
eventPane.add(evtBox);
eventPane.add(typeBox);
// eventPane.add(not
eventPane.add(nodeO);
eventPane.add(nodeBox);
eventPane.add(instO);
eventPane.add(ccmBox);
eventPane.add(restartO);
eventPane.add(logBox);
eventPane.add(logSizeExcee dO);
eventPane.add(reBox);
Box buttonBox = Box.createHorizontalBox();
JButton jB = new JButton("Subscribe");
jB.addActionListener(new SubscribeMailAction());
JButton cancel = new JButton("Unsubscribe");
cancel.addActionListener(n ew CancelAction());
buttonBox.add(jB);
buttonBox.add(cancel);
add(mailSelPane, BorderLayout.CENTER);
add(eventPane, BorderLayout.NORTH);
add(buttonBox, BorderLayout.SOUTH);
}
private void createMailPane(){
JPanel mailSelPane = new JPanel(new GridLayout(3, 2, 0, 20));
mailSelPane.setBorder(new TitledBorder
(new LineBorder(Color.black), "Event Notification" ));
JLabel jLab = new JLabel( " Enter Mobile No.");
// textVal = "Don't change this text if SMTP IP is"+
// "valid in config file";
tF = new JTextField();
tF.setText("Not Available In This Version!!");
// tF.setText("");
tF.setEditable(false);
JLabel jLabs = new JLabel(" Enter E-Mail Id");
tFs = new JTextField();
JLabel pagerLabs = new JLabel(" Enter Pager No.");
JTextField pagerText = new JTextField();
pagerText.setText("Not Available In This Version!!");
// pagerText.setText("");
pagerText.setEditable(fals
mailSelPane.add(jLabs);
mailSelPane.add(tFs);
mailSelPane.add(jLab);//, BorderLayout.NORTH);
mailSelPane.add(tF);
mailSelPane.add(pagerLabs)
mailSelPane.add(pagerText)
JPanel eventPane = new JPanel(new GridLayout(5, 2));
eventPane.setBorder(new TitledBorder
(new LineBorder(Color.black), "Events" ));
Box nodeBox = Box.createHorizontalBox();
mail = new JCheckBox(" ");
JCheckBox sms = new JCheckBox( " ");
sms.setEnabled(false);
JCheckBox pager = new JCheckBox(" ");
pager.setEnabled(false);
nodeBox.add(mail);
nodeBox.add(sms);
nodeBox.add(pager);
Box ccmBox = Box.createHorizontalBox();
//JCheckBox
ccmmail = new JCheckBox(" ");
JCheckBox ccmsms = new JCheckBox( " ");
ccmsms.setEnabled(false);
JCheckBox ccmpager = new JCheckBox(" ");
ccmpager.setEnabled(false)
ccmBox.add(ccmmail);
ccmBox.add(ccmsms);
ccmBox.add(ccmpager);
Box logBox = Box.createHorizontalBox();
JCheckBox logmail = new JCheckBox(" ");
logmail.setEnabled(false);
JCheckBox logsms = new JCheckBox( " ");
logsms.setEnabled(false);
JCheckBox logpager = new JCheckBox(" ");
logpager.setEnabled(false)
logBox.add(logmail);
logBox.add(logsms);
logBox.add(logpager);
Box reBox = Box.createHorizontalBox();
JCheckBox remail = new JCheckBox(" ");
remail.setEnabled(false);
JCheckBox resms = new JCheckBox( " ");
resms.setEnabled(false);
JCheckBox repager = new JCheckBox(" ");
repager.setEnabled(false);
reBox.add(remail);
reBox.add(resms);
reBox.add(repager);
nodeO = new JCheckBox("Ovent");
nodeO.addItemListener(new NodeCheckBoxListener());
instO = new JCheckBox("Event");
instO.addItemListener(new InstCheckBoxListener());
restartO = new JCheckBox(" Exceeds (Not Avail!)");
restartO.setEnabled(false)
restartO.addItemListener(n
logSizeExceedO = new JCheckBox("Message");
logSizeExceedO.setEnabled(
logSizeExceedO.addItemList
Box evtBox = Box.createHorizontalBox();
Box typeBox = Box.createHorizontalBox();
JLabel eventNot = new JLabel("Event Available to subscribe");
JLabel mailLabel = new JLabel("Get Mail ");
JLabel pagerLabel = new JLabel("Get Pagerbeep ");
JLabel smsLabel = new JLabel(" SMS");
evtBox.add(eventNot);
typeBox.add(mailLabel);
typeBox.add(pagerLabel);
typeBox.add(smsLabel);
eventPane.add(evtBox);
eventPane.add(typeBox);
// eventPane.add(not
eventPane.add(nodeO);
eventPane.add(nodeBox);
eventPane.add(instO);
eventPane.add(ccmBox);
eventPane.add(restartO);
eventPane.add(logBox);
eventPane.add(logSizeExcee
eventPane.add(reBox);
Box buttonBox = Box.createHorizontalBox();
JButton jB = new JButton("Subscribe");
jB.addActionListener(new SubscribeMailAction());
JButton cancel = new JButton("Unsubscribe");
cancel.addActionListener(n
buttonBox.add(jB);
buttonBox.add(cancel);
add(mailSelPane, BorderLayout.CENTER);
add(eventPane, BorderLayout.NORTH);
add(buttonBox, BorderLayout.SOUTH);
}
ASKER
I haven't used anywhere set Preferred sixe or Max or minimum size other then
Top level JFrane size as 600, 450.
Top level JFrane size as 600, 450.
Why do you have parts of code, such like that ?
>>>>>>>>>>>>>
Box nodeBox = Box.createHorizontalBox();
mail = new JCheckBox(" ");
JCheckBox sms = new JCheckBox( " ");
sms.setEnabled(false);
JCheckBox pager = new JCheckBox(" ");
pager.setEnabled(false);
nodeBox.add(mail);
nodeBox.add(sms);
nodeBox.add(pager);
<<<<<<<<<<<<<<
Do you have the same problem, if the strings(the empty strings) are not too long ?
GridLayout retains the width ot the components, so in my opinion that's the reason for the problem.
Best Regards,
Valeri
>>>>>>>>>>>>>
Box nodeBox = Box.createHorizontalBox();
mail = new JCheckBox(" ");
JCheckBox sms = new JCheckBox( " ");
sms.setEnabled(false);
JCheckBox pager = new JCheckBox(" ");
pager.setEnabled(false);
nodeBox.add(mail);
nodeBox.add(sms);
nodeBox.add(pager);
<<<<<<<<<<<<<<
Do you have the same problem, if the strings(the empty strings) are not too long ?
GridLayout retains the width ot the components, so in my opinion that's the reason for the problem.
Best Regards,
Valeri
ASKER
MAy be I didn't try that, but in the current scenario, even dragging to expand the Panel doesn't wotk Properly
..
..
Yes I agree with Valeri, the GridLayout's going to resize each grid component to the same size.
ASKER
I found one relation.
In one JTabbedPane I have two JPanels.
In one Panel I use GridLayout and boxes and JScrollPane seems to behave properly.
IN other I have again three Panel with GridLayout but in one Grid I have JCheckBox with a long Strings, so that it is not fully visible if opened to default. (No problem).
After openeing this JScrollPane becomes unscrollable. Even when I go back to previosu Panel, it also doesn't scrolls. But in other JTabbedPAne
where I have again simple GridLyout and Boxes it behaves fine.
So that now if I want to expand or contract the Panel I have to come to this Panel.
how to solve this.
In one JTabbedPane I have two JPanels.
In one Panel I use GridLayout and boxes and JScrollPane seems to behave properly.
IN other I have again three Panel with GridLayout but in one Grid I have JCheckBox with a long Strings, so that it is not fully visible if opened to default. (No problem).
After openeing this JScrollPane becomes unscrollable. Even when I go back to previosu Panel, it also doesn't scrolls. But in other JTabbedPAne
where I have again simple GridLyout and Boxes it behaves fine.
So that now if I want to expand or contract the Panel I have to come to this Panel.
how to solve this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Over the Panel that contains this Layout.
Once I click on this Panel, and I swicth to other Panel scrolling the Bar doesn't work properly.
So I should call this over the parent JTabbedPane or in all other Panels.
Once I click on this Panel, and I swicth to other Panel scrolling the Bar doesn't work properly.
So I should call this over the parent JTabbedPane or in all other Panels.
ASKER
Yo it solved the problem, once I am calling
setMinimumSize(new Dimension(0, 0))
on the Panels, which were giving problem, this problem is no more there.
take care
paperless
setMinimumSize(new Dimension(0, 0))
on the Panels, which were giving problem, this problem is no more there.
take care
paperless
only 6 questions graded