public MessageDialog(Frame parent, String sender, String msg) { super(parent, "Msg from " + sender); Button ok=new Button("OK"); setLayout(new BorderLayout()); setBackground(Color.white); ok.setFont(default_font); text.setFont(default_font); text.setEditable(false); text.setText(msg); ok.addActionListener(this); add("Center", text); add("South", ok); setSize(300, 150); Point my_loc=parent.getLocation(); my_loc.x+=50; my_loc.y+=150; setLocation(my_loc); Toolkit.getDefaultToolkit().beep(); show(); }
public SendDialog(Frame parent, Node dest, String src, RpcDispatcher disp) { super(parent, "Send message to " + dest.lbl + " at " + dest.addr, true); Panel p1=new Panel(), p2=new Panel(); Button send=new Button("Send"), send_all=new Button("Send to all"); Button cancel=new Button("Cancel"); this.disp=disp; this.dest=dest; sender=src; send.setFont(default_font); send_all.setFont(default_font); cancel.setFont(default_font); msg.setFont(default_font); p1.setLayout(new BorderLayout()); p1.add(msg); p2.setLayout(new FlowLayout()); send.addActionListener(this); send_all.addActionListener(this); cancel.addActionListener(this); p2.add(send); p2.add(send_all); p2.add(cancel); add("Center", p1); add("South", p2); setSize(300, 150); Point my_loc=parent.getLocation(); my_loc.x+=50; my_loc.y+=150; setLocation(my_loc); setVisible(true); }
startBrowser.setActionCommand("console"); startBrowser.addActionListener(this); startBrowser.setFont(font); mainPanel.add(startBrowser, constraintsButton); frame.add(mainPanel, constraintsPanel);
Panel p = new Panel(); leave_button = new Button("Exit"); leave_button.setFont(default_font); leave_button.addActionListener(this); mbr_label = new Label("1 mbr(s)");
public UserInfoDialog(Frame parent) { super(parent, "Input", true); setLayout(null); l.setFont(default_font); l.setSize(50, 30); l.setLocation(30, 50); name.setFont(default_font); name.setSize(150, 30); name.setLocation(90, 50); //name.selectAll(); ok.setFont(default_font); ok.setSize(50, 30); ok.setLocation(30, 90); add(l); add(name); add(ok); ok.addActionListener(this); setSize(300, 150); Point my_loc=parent.getLocation(); my_loc.x+=50; my_loc.y+=150; setLocation(my_loc); show(); }
Button[][] buttons = new Button[][]{{}}; // fill your buttons array for (Button[] bb : buttons) { for (Button b : bb) { if (BUTTON SHOULD BE BOLD) { Font font = b.getFont(); Font bold = new Font(font.getName(), Font.BOLD, font.getSize()); b.setFont(bold); } } }
private void createListeners() { if (srcImp==null) return; ImagePlus.addImageListener(this); Roi.addRoiListener(this); if (live!=null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.BOLD, font.getSize())); live.setForeground(Color.red); } }
private void removeListeners() { if (srcImp==null) return; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live!=null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
private void createListeners() { if (srcImp==null) return; ImagePlus.addImageListener(this); Roi.addRoiListener(this); if (live!=null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.BOLD, font.getSize())); live.setForeground(Color.red); } }
private void removeListeners() { if (srcImp==null) return; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live!=null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
private void disableLivePlot() { if (IJ.debugMode) IJ.log("PlotWindow.disableLivePlot: "+srcImp); if (srcImp==null) return; if (bgThread!=null) bgThread.interrupt(); bgThread = null; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live != null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
private void disableLivePlot() { if (IJ.debugMode) IJ.log("PlotWindow.disableLivePlot: "+srcImp); if (srcImp==null) return; if (bgThread!=null) bgThread.interrupt(); bgThread = null; ImagePlus.removeImageListener(this); Roi.removeRoiListener(this); if (live != null) { Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); } }
private void enableLivePlot() { if (plotMaker==null) plotMaker = plot!=null?plot.getPlotMaker():null; if (plotMaker==null) return; srcImp = plotMaker.getSourceImage(); if (srcImp==null) return; if (bgThread==null) { bgThread = new Thread(this, "Live Plot"); bgThread.setPriority(Math.max(bgThread.getPriority()-3, Thread.MIN_PRIORITY)); doUpdate = true; bgThread.start(); } if (IJ.debugMode) IJ.log("PlotWindow.createListeners"); ImagePlus.addImageListener(this); Roi.addRoiListener(this); Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.BOLD, font.getSize())); live.setForeground(Color.red); }
private Button addButton(final String label) { final Button b = new Button(label); b.setPreferredSize(new Dimension(86,22)); b.setForeground(Color.black); b.setFont(dialogfont); b.addActionListener(this); b.addMouseListener(this); gbc.gridx = leftbutton ? 0 : 1; gbc.insets = new Insets(newblock?space:0,0,0,0); gbl.setConstraints(b,gbc); add(b); leftbutton = !leftbutton; if (leftbutton) { ++gbc.gridy; newblock = false; } return b; }
private void removeListeners() { //IJ.log("removeListeners"); if(srcImp == null) { return; } ImageCanvas canvas = srcImp.getCanvas(); canvas.removeMouseListener(this); canvas.removeMouseMotionListener(this); canvas.removeKeyListener(this); ImagePlus.removeImageListener(this); Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.PLAIN, font.getSize())); live.setForeground(Color.black); }
private void createListeners() { //IJ.log("createListeners"); if(srcImp == null) { return; } ImageCanvas canvas = srcImp.getCanvas(); if(canvas == null) { return; } canvas.addMouseListener(this); canvas.addMouseMotionListener(this); canvas.addKeyListener(this); ImagePlus.addImageListener(this); Font font = live.getFont(); live.setFont(new Font(font.getName(), Font.BOLD, font.getSize())); live.setForeground(Color.red); }
public MessageDialog(Frame parent, String sender, String msg) { super(parent, "Msg from " + sender); Button ok=new Button("OK"); setLayout(new BorderLayout()); setBackground(Color.white); ok.setFont(default_font); text.setFont(default_font); text.setEditable(false); text.setText(msg); ok.addActionListener(this); add("Center", text); add("South", ok); setSize(300, 150); Point my_loc=parent.getLocation(); my_loc.x+=50; my_loc.y+=150; setLocation(my_loc); Toolkit.getDefaultToolkit().beep(); show(); }
public MessageDialog(Frame parent, String sender, String msg) { super(parent, "Msg from " + sender); Button ok=new Button("OK"); setLayout(new BorderLayout()); setBackground(Color.white); ok.setFont(default_font); text.setFont(default_font); text.setEditable(false); text.setText(msg); ok.addActionListener(this); add("Center", text); add("South", ok); setSize(300, 150); Point my_loc=parent.getLocation(); my_loc.x+=50; my_loc.y+=150; setLocation(my_loc); Toolkit.getDefaultToolkit().beep(); show(); }
public MessageDialog(Frame parent, String sender, String msg) { super(parent, "Msg from " + sender); Button ok=new Button("OK"); setLayout(new BorderLayout()); setBackground(Color.white); ok.setFont(default_font); text.setFont(default_font); text.setEditable(false); text.setText(msg); ok.addActionListener(this); add("Center", text); add("South", ok); setSize(300, 150); Point my_loc=parent.getLocation(); my_loc.x+=50; my_loc.y+=150; setLocation(my_loc); Toolkit.getDefaultToolkit().beep(); show(); }