Skip to main content



      Home
Home » Newcomers » Newcomers » scrollbars don't scroll in Composite(no scrolling allowed!)
scrollbars don't scroll in Composite [message #1779800] Fri, 12 January 2018 15:22 Go to next message
Eclipse UserFriend
I'm sure this has been answered before, but I just can't find it.
Eclipse Helios RCP code
Java 1.6

Now that everyone has finished laughing ...
I added a Composite inside another composite and I run through a loop, adding an unknown number of buttons to the second Composite. I did try using a ScrolledComposite, but can't get the buttons to appear in it, so I'm using a vanilla Composite. The scrollbars appear, but don't do anything.

Code speaks louder than words. I've left stuff out, but this is the gist. I'm sure there's something simple I've left out, like enabling scrolling or reciting the Pledge of Allegiance.

Composite wComp1 = new Composite(wComp, SWT.V_SCROLL|SWT.H_SCROLL);
wComp1.setBackground(null);

setControl(wComp1);
wComp1.setLayout(new FormLayout());

wData = new FormData();
wData.top = new FormAttachment(wLastControl, 20);
wData.left = new FormAttachment(0, 10);
wData.right = new FormAttachment(100, -10);
wData.bottom = new FormAttachment(100, -10);
wComp1.setLayoutData(wData);

try {
//get the data
pCodes[] = ...... (omitted)

for (int i = 0; i < pCodes.length; i++) {
if (pCodes[i].getPayerBypassCode() != BigInteger.ZERO) {
Button wButton = new Button(wComp1, SWT.CHECK);
wButton.setBackground(null);
wData = new FormData();
wData.left = new FormAttachment(0, 25);
wData.top = new FormAttachment(wLastControl, 5);
wButton.setLayoutData(wData);
addPayerBypassButton(wButton, pCodes[i]);
wButton.addSelectionListener(new SelectionListener() {
---------------------------------------------------------------------------------------------------------------

Appreciate any help!

Re: scrollbars don't scroll in Composite [message #1779815 is a reply to message #1779800] Sat, 13 January 2018 03:03 Go to previous messageGo to next message
Eclipse UserFriend
I'm not sure the answer, but perhaps the SWT Snippets contain an example https://www.eclipse.org/swt/snippets/ if you search for the word "scroll" on that page.
Re: scrollbars don't scroll in Composite [message #1779836 is a reply to message #1779815] Sun, 14 January 2018 03:50 Go to previous messageGo to next message
Eclipse UserFriend
Does anything look amiss other than the scrolling not being available?
Re: scrollbars don't scroll in Composite [message #1779997 is a reply to message #1779836] Tue, 16 January 2018 07:52 Go to previous messageGo to next message
Eclipse UserFriend
Nothing looks bad. The checkboxes appear, but continue off the viewable area. I'm unable to scroll down to view more boxes.
Re: scrollbars don't scroll in Composite [message #1780046 is a reply to message #1779997] Tue, 16 January 2018 14:10 Go to previous messageGo to next message
Eclipse UserFriend
What layout is wComp (not wComp1) using?
Re: scrollbars don't scroll in Composite [message #1780049 is a reply to message #1780046] Tue, 16 January 2018 15:02 Go to previous message
Eclipse UserFriend
wComp.setLayout(new FormLayout());
Previous Topic:Restore Deleted Files
Next Topic:Why does Eclipse reopen closed files on restart?
Goto Forum:
  


Current Time: Thu Jun 12 18:45:54 EDT 2025

Powered by FUDForum. Page generated in 0.08983 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top