- 전체
- JAVA 일반
- JAVA 수학
- JAVA 그래픽
- JAVA 자료구조
- JAVA 인공지능
- JAVA 인터넷
- Java Framework
- Java GUI (AWT,SWING,SWT,JFACE)
- SWT and RCP (web RAP/RWT)[eclipse], EMF
Java GUI (AWT,SWING,SWT,JFACE) SWT 스크롤 ScrolledComposite
2015.05.03 14:59
SWT 스크롤 ScrolledComposite

//Send questions, comments, bug reports, etc. to the authors: //Rob Warner (rwarner@interspatial.com) //Robert Harris (rbrt_harris@yahoo.com) import org.eclipse.swt.SWT; import org.eclipse.swt.custom.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; /** * This class demonstrates ScrolledComposite */ public class ScrolledCompositeTest { public void run() { Display display = new Display(); Shell shell = new Shell(display); createContents(shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } private void createContents(Composite parent) { parent.setLayout(new FillLayout()); // Create the ScrolledComposite to scroll horizontally and vertically ScrolledComposite sc = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL); // Create a child composite to hold the controls Composite child = new Composite(sc, SWT.NONE); child.setLayout(new FillLayout()); // Create the buttons new Button(child, SWT.PUSH).setText("One"); new Button(child, SWT.PUSH).setText("Two"); /* * // Set the absolute size of the child child.setSize(400, 400); */ // Set the child as the scrolled content of the ScrolledComposite sc.setContent(child); // Set the minimum size sc.setMinSize(400, 400); // Expand both horizontally and vertically sc.setExpandHorizontal(true); sc.setExpandVertical(true); } public static void main(String[] args) { new ScrolledCompositeTest().run(); } }
| sc.setMinSize(400, 400); 이 설정이 중요 |
[출처] http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/DemonstratesScrolledComposite.htm
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 9 | JAVA SWT LINUX (Ubuntu) 에서 SWT Browser Control 사용시 | 졸리운_곰 | 2015.05.10 | 278 |
| 8 | JAVA SWT TEST 자료 | 졸리운_곰 | 2015.05.07 | 752 |
| » |
SWT 스크롤 ScrolledComposite
| 졸리운_곰 | 2015.05.03 | 407 |
| 6 |
SWT JAVA 동적으로 컨트롤을 추가하는 다이얼로그2
| 졸리운_곰 | 2015.04.27 | 325 |
| 5 | SWT JAVA 동적으로 컨트롤을 추가하는 다이얼로그 | 졸리운_곰 | 2015.04.27 | 455 |
| 4 | A simple Java console: | 졸리운_곰 | 2015.04.24 | 312 |
| 3 | SWT – MouseListener & MouseAdapter Example | 졸리운_곰 | 2015.04.22 | 297 |
| 2 |
Java SWT 소개
| 졸리운_곰 | 2015.03.30 | 358 |
| 1 |
Getting Controls on a shell : Shell « SWT « Java Tutorial
| 졸리운_곰 | 2015.03.30 | 229 |

