var Toolbar = function () { var toolbar = this; // toolbar = Toolbar instance this.attr1 = ""; // this = Toolbar instance this.Comment = function () { this.attr1 = toolbar.attr1; // this = Comment instance; }; }; var toolbar1 = new Toolbar(); var comment = new toolbar1.Comment();
public WebPanel() { this.toolbar= new Toolbar(this); } webPanel = new WebPanel(); webPanel.getToolbar() ;
setContentView(R.layout.activity_setting); rootLayout = (RelativeLayout) findViewById(R.id.settingRootLayout); mToolbar = new Toolbar(this); mToolbar.setLayoutParams( new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
Toolbar toolbar = new Toolbar(this); Toolbar.LayoutParams toolBarParams = new Toolbar.LayoutParams( Toolbar.LayoutParams.MATCH_PARENT, R.attr.actionBarSize ); toolbar.setLayoutParams(toolBarParams);
Toolbar myToolbar = new Toolbar(...); myToolbar.setId(toolbar); pane.getChildren().add(myToolbar);
//with the right arguments passed at the constructor Toolbar toolbar = new Toolbar(); FloatingActionButton fab = new FloatingActionButton();
setTitle("Chess game"); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); ImageIcon img = new ImageIcon("pieceImages/whiteKing.png"); contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); Toolbar toolbar = new Toolbar(); JPanel labelsPanel = new JPanel(); GridLayout gridLayout = new GridLayout(8, 8); labelsPanel.setLayout(gridLayout); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { labels[i][j]=new JLabel(game.getBoard()[i][j].getImagePath()); labelsPanel.add(labels[i][j]); } } contentPane.add(toolbar, BorderLayout.NORTH); contentPane.add(labelsPanel, BorderLayout.CENTER); setIconImage(img.getImage()); setResizable(false); setSize(600, 600); setLocationRelativeTo(null); setVisible(true);
private static void createAndShowGui() { Toolbar toolBar = new Toolbar(); TextPanel textPanel = new TextPanel(); toolBar.setTextPanel(textPanel); // ****** passing in my reference ******* JFrame frame = new JFrame("Add New Lines"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.getContentPane().add(textPanel); frame.getContentPane().add(toolBar, BorderLayout.PAGE_START); frame.pack(); frame.setLocationByPlatform(true); frame.setVisible(true); }
private void initComponents() { JFrame mainframe = new JFrame("Main Frame"); Editor editor = new Editor(); Toolbar toolbar = new Toolbar(); toolbar.addListener(editor); // register listener ... }
ChatPanel chatPane = new ChatPanel(); HelloAction action = new HelloAction(chatPane); Toolbar toolBar = new Toolbar(); toolBar.addAction(action); //... Add what ever other actions you might like...
homeToolBar = new Toolbar(false); int ScreenWidth = Display.getInstance().getDisplayWidth(); centerCnt.setWidth(ScreenWidth - 2 * ExitCommand.getIcon().getWidth()); centerCnt.setLayout(new BorderLayout()); centerCnt.addComponent(BorderLayout.CENTER,btnLogo); currentForm.setToolBar(homeToolBar); currentForm.addCommand(SideLogoCommand); homeToolBar.addCommandToSideMenu(MenuCommand); homeToolBar.setTitleComponent(centerCnt); homeToolBar.addCommandToRightBar(ExitCommand); Command BackCMD = new Command("Back") { @Override public void actionPerformed(ActionEvent evt) { System.out.println("Back"); } }; BackCMD.putClientProperty("uiid", "BackCommand"); currentForm.setBackCommand(BackCMD); homeToolBar.addCommandToLeftBar(BackCMD);
import android.support.design.widget.AppBarLayout; import android.support.v4.app.NavUtils; import android.support.v7.widget.Toolbar; private void setupActionBar() { Toolbar toolbar = new Toolbar(this); AppBarLayout appBarLayout = new AppBarLayout(this); appBarLayout.addView(toolbar); final ViewGroup root = (ViewGroup) findViewById(android.R.id.content); final ViewGroup window = (ViewGroup) root.getChildAt(0); window.addView(appBarLayout, 0); setSupportActionBar(toolbar); // Show the Up button in the action bar. getSupportActionBar().setDisplayHomeAsUpEnabled(true); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); }
Toolbar t = new Toolbar(); myForm.setToolbar(t); t.setTitle("My title"); Command back = new Command("back") { @Override public void actionPerformed(ActionEvent evt) { myForm.showBack(); } }; myForm.setBackCommand(back); t.addCommandToLeftBar(back);
private Command myCommand = new Command(""); Form f = new Form("Test form"); Toolbar t = new Toolbar(); f.setToolbar(t); Command back = new Command("Back") { @Override public void actionPerformed(ActionEvent evt) { //Do stuff } }; back.putClientProperty("uiid", "BackCommand"); f.setBackCommand(back); t.addCommandToLeftBar(back); myCommand = new Command(YourProgressImage) { @Override public void actionPerformed(ActionEvent evt) { //To show the progress when some actions are being performed showTitleProgress(t); //When you're done, discard the progress and restore your command hideTitleProgress(t, myCommand); } } myCommand.putClientProperty("TitleCommand", true); t.addCommandToRightBar(myCommand); f.show();
final Form caf = new Form("configure alerts"); Toolbar bar = new Toolbar(); caf.setToolBar(bar); caf.addCommandToSideMenu(...);
Toolbar t = new Toolbar(); f.setToolBar(t); Command news = new Command("News", myIcon) { @Override public void actionPerformed(ActionEvent evt) { } }; news.putClientProperty("uiid", "BackCommand"); f.setBackCommand(news); t.addCommandToLeftBar(news); t.setTitle("My Form");
f.add(c); tool = new Toolbar(); Graphics g = tool.getGraphics(); tool.installStartupTools();
final Form hi = new Form("First"); Button test = new Button("Test"); test.addActionListener((e) -> { Form newForm = new Form("Bye"); newForm.setToolbar(new Toolbar()); newForm.setBackCommand(new Command("Back") { @Override public void actionPerformed(ActionEvent evt) { hi.showBack(); } }); newForm.show(); }); hi.show();
final Toolbar bar = new Toolbar(); final Form rd = new Form("resource details"); final Resource thisResource = this;
toolbar = new Toolbar(); toolbar.addKeyListener(this); add("Center", toolbar);