public void showResult(Mat img) { Imgproc.resize(img, img, new Size(640, 480)); MatOfByte matOfByte = new MatOfByte(); Imgcodecs.imencode(".jpg", img, matOfByte); byte[] byteArray = matOfByte.toArray(); BufferedImage bufImage = null; try { InputStream in = new ByteArrayInputStream(byteArray); bufImage = ImageIO.read(in); JFrame frame = new JFrame(); frame.getContentPane().add(new JLabel(new ImageIcon(bufImage))); frame.pack(); frame.setVisible(true); } catch (IOException | HeadlessException e) { e.printStackTrace(); } }
@Test public void loadFX() throws Exception { final CountDownLatch cdl = new CountDownLatch(1); final CountDownLatch done = new CountDownLatch(1); final JFXPanel p = new JFXPanel(); Platform.runLater(new Runnable() { @Override public void run() { Node wv = TestPages.getFX(10, cdl); Scene s = new Scene(new Group(wv)); p.setScene(s); done.countDown(); } }); done.await(); JFrame f = new JFrame(); f.getContentPane().add(p); f.pack(); f.setVisible(true); cdl.await(); }
private static void setup(final Point tmp) { comboBox = new JComboBox<>(); for (int i = 1; i < 7; i++) { comboBox.addItem("Long-long-long-long-long text in the item-" + i); } String property = System.getProperty(PROPERTY_NAME); comboBox.putClientProperty(PROPERTY_NAME, Boolean.valueOf(property)); frame = new JFrame(); frame.setAlwaysOnTop(true); frame.setLayout(new FlowLayout()); frame.add(comboBox); frame.pack(); frame.setSize(frame.getWidth(), SIZE); frame.setVisible(true); frame.setLocation(tmp.x, tmp.y); }
public void show() { JPanel p = new JPanel(new BorderLayout()) { public void paintComponent(Graphics g) { g.setColor(Color.blue); g.fillRect(0, 0, getWidth(), getHeight()); } }; p.add(new ImageComponent(src), BorderLayout.WEST); if (dst != null) { p.add(new ImageComponent(dst), BorderLayout.EAST); } JFrame f = new JFrame("Transparency"); f.add(p); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.pack(); f.setVisible(true); }
/** Display a simple non-modal window showing some text. */ public static JFrame showtext(String title, String text) { JFrame window = new JFrame(title); JButton done = new JButton("Close"); done.addActionListener(Runner.createDispose(window)); JScrollPane scrollPane = OurUtil.scrollpane(OurUtil.textarea(text, 20, 60, false, false)); window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); window.getContentPane().setLayout(new BorderLayout()); window.getContentPane().add(scrollPane, BorderLayout.CENTER); window.getContentPane().add(done, BorderLayout.SOUTH); window.pack(); window.setSize(500, 500); window.setLocationRelativeTo(null); window.setVisible(true); return window; }
@BeforeMethod public void showDialog() throws Throwable { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { frame = new JFrame(JTableHeaderJavaElementTest.class.getSimpleName()); frame.setName("frame-" + JTableHeaderJavaElementTest.class.getSimpleName()); TableDemo demo = new TableDemo(); demo.start(); frame.getContentPane().add(demo, BorderLayout.CENTER); frame.pack(); frame.setAlwaysOnTop(true); frame.setVisible(true); } }); driver = new JavaAgent(); JavaElementFactory.add(JTableHeader.class, JTableHeaderJavaElement.class); }
public MainWindow() { mainFrame = new JFrame("RipMe v" + UpdateUtils.getThisJarVersion()); mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); mainFrame.setLayout(new GridBagLayout()); createUI(mainFrame.getContentPane()); pack(); loadHistory(); setupHandlers(); Thread shutdownThread = new Thread(this::shutdownCleanup); Runtime.getRuntime().addShutdownHook(shutdownThread); if (Utils.getConfigBoolean("auto.update", true)) { upgradeProgram(); } boolean autoripEnabled = Utils.getConfigBoolean("clipboard.autorip", false); ClipboardUtils.setClipboardAutoRip(autoripEnabled); trayMenuAutorip.setState(autoripEnabled); }
public void start() { System.out.println("Starting in applet mode."); InputStream is = this.getClass().getClassLoader().getResourceAsStream( "samples/datasets/southern_women_data.txt"); Reader br = new InputStreamReader(is); TestSouthernWomenBipartite swb; try { swb = new TestSouthernWomenBipartite(br); add(new JLabel("Opening demo in new frame")); JFrame jf = new JFrame(); jf.getContentPane().add(swb); jf.pack(); jf.setVisible(true); } catch (IOException e) { add(new JLabel(e.toString())); e.printStackTrace(); } }
public static void main(String[] args) { Runtime rt = Runtime.getRuntime(); rt.gc(); long start = rt.totalMemory()-rt.freeMemory(); System.out.println( rt.totalMemory()-rt.freeMemory() ); Credit c = null; try { c = new Credit(null, MapApp.MERCATOR_MAP); } catch(Exception e) { e.printStackTrace(); } rt.gc(); System.out.println( rt.totalMemory()-rt.freeMemory() ); System.out.println( (rt.totalMemory()-rt.freeMemory()-start)>>10 ); JFrame f = new JFrame("flags"); f.setDefaultCloseOperation(EXIT_ON_CLOSE); f.getContentPane().add(c.getPanel()); f.pack(); f.setVisible(true); }
/** * Create the GUI and show it. For thread safety, this method should be * invoked from the event-dispatching thread. */ public static JFrame createAndShowGUI() { // Create and set up the window. JFrame frame = new JFrame("DropDemo"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Create and set up the content pane. JComponent newContentPane = new DropDemo(); newContentPane.setOpaque(true); // content panes must be opaque frame.setContentPane(newContentPane); // Display the window. frame.pack(); frame.setVisible(true); return frame; }
/** * Create the GUI and show it. For thread safety, * this method should be invoked from the * event-dispatching thread. */ private static void createAndShowGUI() { //Create and set up the window. //JFrame frame = new JFrame("MenuDemo"); FreeColClient client = new FreeColClient(null, null); client.startClient(null, null, true, true, null, null); FreeColFrame frame = new FreeColFrame(client, GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(), null, null, true, null); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); //Create and set up the content pane. FreeColMenuTest demo = new FreeColMenuTest(); frame.setJMenuBar(demo.createMenuBar()); frame.setContentPane(demo.createContentPane()); //Display the window. frame.setPreferredSize(new Dimension(450, 260)); frame.setVisible(true); }
private void errorDialogue(String messageString, int whichField) { Object[] message = {messageString}; Object[] options = {"OK"}; int n = JOptionPane.showOptionDialog(new JFrame(), message, "Alert!", JOptionPane.ERROR_MESSAGE, JOptionPane.ERROR_MESSAGE, null, options, options[0]); if(JOptionPane.ERROR_MESSAGE == n && whichField == 0){ this.addStudentFullName.setText(""); } else if(n == JOptionPane.ERROR_MESSAGE && whichField == 1){ this.addStudentID.setText("171-15-XXXX"); } else if(n == JOptionPane.ERROR_MESSAGE && whichField == 2){ this.addFathersNameField.setText(""); } else if(n == JOptionPane.ERROR_MESSAGE && whichField == 3){ this.addMothersNameField.setText(""); } else if(n == JOptionPane.ERROR_MESSAGE && whichField == 4){ displayUpdateStudentPanel(true, false); } else if(n == JOptionPane.ERROR_MESSAGE && whichField == 5){ panelVisiblity(true, false, false, false); } else if(n == JOptionPane.ERROR_MESSAGE && whichField == 6){ loginVisiblity(true, false); } else { //DO NOTHING JUST DISPLAY MESSAGE } }
private static void showUI() { sFrame = new JFrame(); sFrame.add(new JLabel("Some dummy content")); JMenuBar menuBar = new JMenuBar(); sMenu = new JMenu("Menu"); JMenuItem item = new JMenuItem("Item"); sMenu.add(item); sMenuItem = new WeakReference<>(item); menuBar.add(sMenu); sFrame.setJMenuBar(menuBar); sFrame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); sFrame.pack(); sFrame.setVisible(true); }
private static void createAndShowGUI() { frame = new JFrame(); final JScrollPane jScrollPane1 = new JScrollPane(); ta = new JTextArea(); ta.setEditable(false); ta.setColumns(20); ta.setRows(5); jScrollPane1.setViewportView(ta); frame.add(ta); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
/** * Method showSplash. */ private void showSplash() { splash = new JFrame(); ImageIcon spl = new ImageIcon(App.class.getResource("resources/splash.png")); JLabel l = new JLabel(); l.setSize(400, 300); l.setIcon(spl); splash.getContentPane().add(l); splash.setSize(400, 300); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); splash.setLocation( (screenSize.width - 400) / 2, (screenSize.height - 300) / 2); splash.setUndecorated(true); splash.setVisible(true); }
/** * Display image in a frame * * @param title * @param img */ public static void imshow(String title, Mat img) { // Convert image Mat to a jpeg MatOfByte imageBytes = new MatOfByte(); Highgui.imencode(".jpg", img, imageBytes); try { // Put the jpeg bytes into a JFrame window and show. JFrame frame = new JFrame(title); frame.getContentPane().add(new JLabel(new ImageIcon(ImageIO.read(new ByteArrayInputStream(imageBytes.toArray()))))); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); frame.setLocation(30 + (windowNo*20), 30 + (windowNo*20)); windowNo++; } catch (Exception e) { e.printStackTrace(); } }
private void start() { Toolkit.getDefaultToolkit().addAWTEventListener( this, KeyEvent.KEY_EVENT_MASK ); TopComponent.getRegistry().addPropertyChangeListener( this ); Window w = SwingUtilities.getWindowAncestor( resizingComponent ); if( w instanceof JFrame ) { frame = ( JFrame ) w; oldGlass = frame.getGlassPane(); glass = new GlassPane( resizingComponent ); frame.setGlassPane( glass ); glass.setVisible( true ); glass.invalidate(); glass.revalidate(); glass.repaint(); glass.refresh(); } }
public static void main(String[] args) throws Exception { Robot robot = new Robot(); SwingUtilities.invokeAndWait(() -> { frame = new JFrame(); frame.setSize(500, 500); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); tabbedPane = new JTabbedPane(); for (int i = 0; i < TAB_COUNT; i++) { tabbedPane.add("Header " + i, new JLabel("Content: " + i)); } frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(tabbedPane, BorderLayout.CENTER); frame.setVisible(true); }); robot.waitForIdle(); SwingUtilities.invokeAndWait(() -> { for (int j = 0; j < ITERATIONS; j++) { for (int i = 0; i < TAB_COUNT; i++) { tabbedPane.setTitleAt(i, getHtmlText(j * TAB_COUNT + i)); } } }); robot.waitForIdle(); SwingUtilities.invokeAndWait(() -> frame.dispose()); }
public UpdateUIRecursionTest() { super("UpdateUIRecursionTest"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(400, 400); String[] listData = { "First", "Second", "Third", "Fourth", "Fifth", "Sixth" }; list = new JList(listData); list.setCellRenderer(this); renderer = new DefaultListCellRenderer(); getContentPane().add(new JScrollPane(list), BorderLayout.CENTER); setVisible(true); }
public static void main(String[] args) throws InterruptedException, InvocationTargetException { SwingUtilities.invokeAndWait(() -> { JFrame f = new JFrame(); f.setUndecorated(true); f.setBackground(new Color(0, 0, 0, 0)); f.setSize(200, 300); f.setVisible(true); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); } catch (Exception e) { System.err.println(e); System.err.println("Could not set GTKLookAndFeel, skipping this test"); } finally { f.dispose(); } }); }
public void save() throws IOException { initChooser(); int ok = JOptionPane.NO_OPTION; if( file!=null ) { ok = JOptionPane.showConfirmDialog( (JFrame)getTopLevelAncestor(), "overwrite "+file.getName()+"?", "overwrite?", JOptionPane.YES_NO_CANCEL_OPTION); if( ok==JOptionPane.CANCEL_OPTION) return; chooser.setSelectedFile( file); } if( ok==JOptionPane.NO_OPTION) { ok = chooser.showSaveDialog((JFrame)getTopLevelAncestor()); if( ok==chooser.CANCEL_OPTION) return; file = chooser.getSelectedFile(); } apply(); String type = file.getName().substring( file.getName().indexOf(".")+1).toLowerCase(); if( !type.equals("jpg") && !type.equals("png") && !type.equals("tif")) type="jpg"; ImageIO.write( image, type, file); }
@BeforeMethod public void showDialog() throws Throwable { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { frame = new JFrame(RComboBox2Test.class.getName()); frame.setName("dialog-1"); Employee[] items = { new Employee("Phillip"), new Employee("Larry"), new Employee("Lisa"), new Employee("James"), new Employee("Larry") }; MyComboBoxModel model = new MyComboBoxModel(items); JComboBox comboBox = new JComboBox(model); comboBox.setName("Employee"); frame.getContentPane().add(comboBox); frame.pack(); frame.setVisible(true); } }); }
public static void main(String[] args) { JFrame frame = new JFrame("Box Plot"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.getContentPane().add(new BoxPlotDemo()); frame.setVisible(true); }
public static void main(String[] args) { JFrame frame = new JFrame("Surface Plot"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.getContentPane().add(new SurfaceDemo()); frame.setVisible(true); }
public static void main(String[] args) { Plot3DPanel p = new Plot3DPanel(); Object[][] XYZ = new Object[8][3]; Object[][] XYZ2 = new Object[10][3]; for (int j = 0; j < XYZ.length; j++) { XYZ[j][0] = Math.random(); XYZ[j][1] = Math.random(); XYZ[j][2] = "" + ((char) ('a' + j)); } for (int j = 0; j < XYZ2.length; j++) { XYZ2[j][0] = Math.random(); XYZ2[j][1] = Math.random(); XYZ2[j][2] = "" + ((char) ('a' + j)); } p.addScatterPlot("toto", p.mapData(XYZ)); p.addScatterPlot("toti", p.mapData(XYZ2)); p.setAxisScale(1, "log"); new FrameView(p).setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); HashMap<String, Double> arg = p.getAxis(2).getStringMap(); Collection<Double> ouch = arg.values(); Iterator<Double> it = ouch.iterator(); while (it.hasNext()) { System.out.println(it.next()); } }
public static void main(String[] args) { JFrame frame = new JFrame("Exponential Distribution"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.getContentPane().add(new ExponentialDistributionDemo()); frame.setVisible(true); }
public static void main(String[] args) { UserObject frame = new UserObject(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400, 320); frame.setVisible(true); }
private static void createAndShowGUI() { JFrame frame = new JFrame("Extended Speech Services Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new ExtendedExample()); frame.pack(); frame.setVisible(true); frame.setLocationRelativeTo(null); }
public static void setIcon(JFrame frame, String icon) { try { frame.setIconImage(ImageIO.read(JUtils.class.getResourceAsStream(icon))); } catch (IOException ex) { StaticStandard.logErr(ex, false); } }
@BeforeMethod public void showDialog() throws InterruptedException, InvocationTargetException, NoSuchWindowException { SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { frame = new JFrame(JTableRowSelectionTest.class.getSimpleName()); frame.setName("frame-" + JTableRowSelectionTest.class.getSimpleName()); frame.getContentPane().add(new TableSelectionDemo(), BorderLayout.CENTER); frame.pack(); frame.setAlwaysOnTop(true); frame.setVisible(true); } }); }
public static void main(String[] args) { JFrame frame = new JFrame("Gaussian Mixture"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.getContentPane().add(new GaussianMixtureDemo()); frame.setVisible(true); }
@Override protected void prepareControls() { JDesktopPane desktopPane = new JDesktopPane(); JInternalFrame bottomFrame = new JInternalFrame("bottom frame", false, false, false, false); bottomFrame.setSize(220, 220); super.propagateAWTControls(bottomFrame); desktopPane.add(bottomFrame); bottomFrame.setVisible(true); JInternalFrame topFrame = new JInternalFrame("top frame", false, false, false, false); topFrame.setSize(200, 200); topFrame.add(new JButton("LW Button") { { addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { lwClicked = true; } }); } }); desktopPane.add(topFrame); topFrame.setVisible(true); JFrame frame = new JFrame("Test Window"); frame.setSize(300, 300); frame.setContentPane(desktopPane); frame.setVisible(true); locTopFrame = topFrame.getLocationOnScreen(); locTarget = new Point(locTopFrame.x + bottomFrame.getWidth() / 2, locTopFrame.y + bottomFrame.getHeight()/2); }
public KFuzzyScatter(int x, int y, WorkloadAnalysisSession model, JFrame f, int clustering, int clust/*,double err*/) { //Passare il numero del clustering super(); parent = f; //this.err = err; graph = new BufferedImage(WIDTH + 1, HEIGHT + 1, BufferedImage.TYPE_INT_RGB); valueFormat = new DecimalFormat("####.##E0"); parent.setResizable(false); curClust = clust; this.clustering = clustering; //c1 = ((FuzzyKMean)(model.getListOfClustering().get(clustering))).getAssignment(curClust); c1 = ((ClusteringInfosFuzzy) ((FuzzyKMean) (model.getListOfClustering().get(clustering))).getClusteringInfos(curClust)).getAssignment(); xVar = x; yVar = y; this.model = (ModelWorkloadAnalysis) model.getDataModel(); this.session = model; this.model.addOnChangeVariableValue(new ChangeVariableListener() { public void onChangeVariableValues() { first = true; xMin = KFuzzyScatter.this.model.getMatrix().getVariables()[xVar].getUniStats().getMinValue(); xMax = KFuzzyScatter.this.model.getMatrix().getVariables()[xVar].getUniStats().getMaxValue(); yMin = KFuzzyScatter.this.model.getMatrix().getVariables()[yVar].getUniStats().getMinValue(); yMax = KFuzzyScatter.this.model.getMatrix().getVariables()[yVar].getUniStats().getMaxValue(); repaint(); } }); xMin = this.model.getMatrix().getVariables()[xVar].getUniStats().getMinValue(); xMax = this.model.getMatrix().getVariables()[xVar].getUniStats().getMaxValue(); yMin = this.model.getMatrix().getVariables()[yVar].getUniStats().getMinValue(); yMax = this.model.getMatrix().getVariables()[yVar].getUniStats().getMaxValue(); p = new GlassPanel(); f.setGlassPane(p); p.setVisible(true); addMouseListener(p); addMouseMotionListener(p); }
public Busqueda(Connection conn, JFrameJTable principal, String sql, char QuienEs) { setIconImage(Toolkit.getDefaultToolkit().getImage(Busqueda.class.getResource("/biblioteca/images/book.png"))); this.QuienEs=QuienEs; this.conn=conn; this.principal=principal; this.principal.setEnabled(false); setTitle("B�squeda"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setBounds(100, 100, 492, 370); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); txtUsuario = new JTextField(); txtUsuario.setBounds(10, 33, 328, 23); contentPane.add(txtUsuario); txtUsuario.setColumns(10); txtUsuario.addKeyListener(this); btnBuscar = new JButton("Buscar"); btnBuscar.setBounds(357, 32, 109, 23); contentPane.add(btnBuscar); btnBuscar.addActionListener(this); table = new PanelJtable(conn,sql,this); table.setBounds(10, 78, 456, 242); contentPane.add(table); addWindowListener(this); setVisible(true); setLocationRelativeTo(null); }
public ApsFrameExtractor(final AEChip chip) { super(chip); apsDisplay = ImageDisplay.createOpenGLCanvas(); apsDisplay.addMouseMotionListener(new MouseInfo(apsDisplay)); apsFrame = new JFrame("APS Frame"); apsFrame.setPreferredSize(new Dimension(400, 400)); apsFrame.getContentPane().add(apsDisplay, BorderLayout.CENTER); apsFrame.pack(); apsFrame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(final WindowEvent e) { setShowAPSFrameDisplay(false); } }); apsDisplayLegend = apsDisplay.addLegend("", 0, 0); final float[] displayColor = new float[3]; displayColor[0] = 1.0f; displayColor[1] = 1.0f; displayColor[2] = 1.0f; apsDisplayLegend.color = displayColor; initFilter(); setPropertyTooltip("invertIntensity", "Inverts grey scale, e.g. for raw samples of signal level"); setPropertyTooltip("preBufferFrame", "Only display and use complete frames; otherwise display APS samples as they arrive"); setPropertyTooltip("logCompress", "Should the displayBuffer be log compressed"); setPropertyTooltip("logDecompress", "Should the logComressed displayBuffer be rendered in log scale (true) or linearly (false)"); setPropertyTooltip("displayContrast", "Gain for the rendering of the APS display"); setPropertyTooltip("displayBrightness", "Offset for the rendering of the APS display"); setPropertyTooltip("extractionMethod", "Method to extract a frame; CDSframe is the final result after subtracting signal from reset frame. Signal and reset frames are the raw sensor output before correlated double sampling."); setPropertyTooltip("showAPSFrameDisplay", "Shows the JFrame frame display if true"); chip.addObserver(this); }
private void buildWindow() { setTitle(WINDOW_TITLE); setSize(FRAME_WIDTH, FRAME_HEIGHT); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLocationRelativeTo(null); setResizable(false); }
public static void testPlot_3() { System.out.println("=============================================================================="); System.out.println("plotting in your own panel , ie embedding the plot"); System.out.println("=============================================================================="); // explicitly create a plot JFrame frame = new JFrame(); frame.setSize(new Dimension(600,600)); ///TODO frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container pane = frame.getContentPane(); //JPanel pane = new JPanel(); Figure fig1 = new Figure(pane); // simple plot (opens new window or uses existing one) double xVals[] = {1.0,2.0,3.0,4.0,5.0}; double yVals[] = {1.1,2.2,3.3,4.4,5.5}; fig1.addPlot(xVals,yVals,"curve 1"); fig1.drawnow(); frame.setVisible(true); fig1.wait(1000); // elementary layout fig1.setXlabel("x-axis","x-unit"); fig1.setYlabel("y-axis","y-unit"); fig1.setAxisTitle("My title"); fig1.drawnow(); frame.setVisible(true); fig1.wait(1000); // add another curve double xVals2[] = {1.0,2.0,3.0,4.0,5.0}; double yVals2[] = {4.1,4.2,4.3,4.4,4.5}; fig1.addPlot(xVals2,yVals2,"curve 2"); fig1.drawnow(); frame.setVisible(true); fig1.wait(3000); }
public static void main(String args[]) { JFrame frame = new JFrame(); JPanel panel = new JPanel(); frame.add(panel); panel.add(new JLabel("north", new ArrowIcon(ArrowIcon.NORTH), JLabel.CENTER)); panel.add(new JLabel("west", new ArrowIcon(ArrowIcon.WEST), JLabel.CENTER)); panel.add(new JLabel("south", new ArrowIcon(ArrowIcon.SOUTH), JLabel.CENTER)); panel.add(new JLabel("east", new ArrowIcon(ArrowIcon.EAST), JLabel.CENTER)); panel.add(new JLabel("east-20", new ArrowIcon(ArrowIcon.EAST, 20, Color.blue), JLabel.CENTER)); frame.pack(); frame.setVisible(true); }
public JMenuBar makeMenuBar(JFrame frame) { JMenuBar menuBar = new JMenuBar(); for (int i = 0; i < mysterMenuFactories.size(); i++) { menuBar.add(mysterMenuFactories.get(i).makeMenu(frame)); } return menuBar; }