📄 fakeqq.java
字号:
package com.hnjchina.example.qq;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
/**
* @author Jove
*/
public class FakeQQ {
private static Composite comp2;
private static Composite pane;
private static ScrolledComposite sc;
public static void main(String[] args) {
final Display display = new Display();
final Shell shell = new Shell();
shell.setImage(ResourceManager.getImage(FakeQQ.class, "72000004.bmp"));
shell.setBackground(ResourceManager.getColor(236, 242, 252));
shell.setSize(150, 396);
final GridLayout gridLayout_2 = new GridLayout();
gridLayout_2.verticalSpacing = 0;
gridLayout_2.marginWidth = 0;
gridLayout_2.marginHeight = 0;
gridLayout_2.horizontalSpacing = 0;
shell.setLayout(gridLayout_2);
shell.setText("QQ2003");
{
pane = new Composite(shell, SWT.NONE);
pane.setBackground(ResourceManager.getColor(236, 242, 252));
pane.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_CENTER | GridData.GRAB_VERTICAL
| GridData.VERTICAL_ALIGN_BEGINNING));
final GridLayout gridLayout_3 = new GridLayout();
gridLayout_3.verticalSpacing = 0;
gridLayout_3.marginWidth = 0;
gridLayout_3.marginHeight = 0;
gridLayout_3.horizontalSpacing = 0;
pane.setLayout(gridLayout_3);
{
final Label label = new Label(pane, SWT.NONE);
final GridData gridData = new GridData(
GridData.HORIZONTAL_ALIGN_FILL);
label.setLayoutData(gridData);
label.setImage(ResourceManager.getImage(FakeQQ.class,
"number.bmp"));
}
{
comp2 = new HideInvisibleComposite(pane, SWT.NONE);
comp2
.setLayoutData(new GridData(
GridData.HORIZONTAL_ALIGN_FILL));
final GridLayout gridLayout = new GridLayout();
gridLayout.verticalSpacing = 0;
gridLayout.horizontalSpacing = 0;
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
comp2.setLayout(gridLayout);
{
final Button button = new Button(comp2, SWT.NONE);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
sc.setVisible(!sc.isVisible());
pane.layout();
}
});
button
.setLayoutData(new GridData(
GridData.FILL_HORIZONTAL));
button.setText("我的好友");
}
{
sc = new ScrolledComposite(comp2, SWT.V_SCROLL);
sc.setAlwaysShowScrollBars(true);
sc.setExpandVertical(true);
sc.setExpandHorizontal(true);
final GridData gridData = new GridData(
GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_FILL);
sc.setLayoutData(gridData);
sc.setLayout(new GridLayout());
{
final Composite composite_2 = new Composite(sc,
SWT.NONE);
composite_2.setBackground(ResourceManager.getColor(236,
242, 252));
final GridLayout gridLayout_1 = new GridLayout();
gridLayout_1.verticalSpacing = 3;
gridLayout_1.marginWidth = 3;
gridLayout_1.marginHeight = 3;
gridLayout_1.horizontalSpacing = 3;
composite_2.setLayout(gridLayout_1);
composite_2.setSize(30, 550);
sc.setContent(composite_2);
{
final Button button = new Button(composite_2,
SWT.NONE);
button.setImage(ResourceManager.getImage(
FakeQQ.class, "logo1.bmp"));
final GridData gridData_1 = new GridData(
GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_CENTER);
gridData_1.heightHint = 50;
gridData_1.widthHint = 50;
button.setLayoutData(gridData_1);
}
{
final Button button = new Button(composite_2,
SWT.NONE);
button.setImage(ResourceManager.getImage(
FakeQQ.class, "logo2.bmp"));
final GridData gridData_1 = new GridData(
GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_CENTER);
gridData_1.heightHint = 50;
gridData_1.widthHint = 50;
button.setLayoutData(gridData_1);
}
{
final Button button = new Button(composite_2,
SWT.NONE);
button.setImage(ResourceManager.getImage(
FakeQQ.class, "logo3.bmp"));
final GridData gridData_1 = new GridData(
GridData.GRAB_HORIZONTAL
| GridData.HORIZONTAL_ALIGN_CENTER);
gridData_1.heightHint = 50;
gridData_1.widthHint = 50;
button.setLayoutData(gridData_1);
}
{
final Button button = new Button(composite_2,
SWT.NONE);
button.setImage(ResourceManager.getImage(
FakeQQ.class, "logo4.bmp"));
final GridData gridData_1 = new GridData(
GridData.HORIZONTAL_ALIGN_CENTER);
gridData_1.heightHint = 50;
gridData_1.widthHint = 50;
button.setLayoutData(gridData_1);
}
}
}
}
{
final Button button = new Button(pane, SWT.NONE);
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
| GridData.VERTICAL_ALIGN_FILL));
button.setText("我的群");
}
{
final Button button = new Button(pane, SWT.NONE);
button.setLayoutData(new GridData(
GridData.HORIZONTAL_ALIGN_FILL));
button.setText("陌生人");
}
{
final Button button = new Button(pane, SWT.NONE);
button.setLayoutData(new GridData(
GridData.HORIZONTAL_ALIGN_FILL));
button.setText("黑名单");
}
}
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -