Apache Pivot教程 – Rollup
Rollup是收缩控制器,有很好的动画效果
package rollup_java;
import org.apache.pivot.wtk.*;
import org.apache.pivot.collections.*;
public class rollup_java implements Application
{
private Window window=null;
public static void main(String [] args)
{
try
{
DesktopApplicationContext.main(rollup_java.class, args);
}
catch(Throwable err)
{
}
}
@Override
public void startup(Display display, Map<String, String>properties)
{
window=new Window();
BoxPane panel=new BoxPane();
Rollup rollup1=new Rollup();
rollup1.setHeading(new Label("hello"));
//设置标题
rollup1.setExpanded(true);
//是否展开
panel.add(rollup1);
Label label1=new Label("hi");
rollup1.setContent(label1);
//设置包含控件,如果要多个控件可以用BoxPane
panel.getStyles().put("padding", 10);
window.setContent(panel);
window.setTitle("Rollups");
window.setMaximized(true);
window.open(display);
}
@Override
public boolean shutdown(boolean optional)
{
if(window!=null)
{
window.close();
}
return false;
}
@Override
public void suspend()
{
}
@Override
public void resume()
{
}
}