This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270120 - sidebar panel not top align if scrollable="true"
Summary: sidebar panel not top align if scrollable="true"
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 8.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-19 08:18 UTC by mcheung63
Modified: 2017-06-04 14:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
panel not top align (2.19 MB, image/png)
2017-03-19 08:18 UTC, mcheung63
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mcheung63 2017-03-19 08:18:39 UTC
Created attachment 163883 [details]
panel not top align

please see attachment first

	<folder name="Editors">
		<folder name="SideBar">
			<file name="com-pdk-sidebar-AddressSideBarFactory.instance">
				<attr name="position" intvalue="0"/>
				<attr name="location" stringvalue="West"/>
				<attr name="scrollable" boolvalue="true"/>
			</file>
		</folder>
	</folder>

public class AddressSideBarFactory implements org.netbeans.spi.editor.SideBarFactory {

	public static AddressPanel addressPanel;

	@Override
	public JComponent createSideBar(JTextComponent jtc) {
		AddressSideBarFactory.addressPanel = new AddressPanel(jtc);

		int width = jtc.getFontMetrics(jtc.getFont()).stringWidth("00000000");
		addressPanel.setPreferredSize(new Dimension(width, 100));
                return addressPanel;
        }
}
Comment 1 mcheung63 2017-06-01 18:56:22 UTC
Anyone can help out?
Comment 2 Geertjan Wielenga 2017-06-04 09:24:16 UTC
Nobody can help out. You're going to have to create a small example that reproduces this problem, put that small example on GitHub.
Comment 3 mcheung63 2017-06-04 14:47:12 UTC
i fixed this by adding "addressPanel.setAlignmentY(Component.BOTTOM_ALIGNMENT);"