List of usage examples for javax.swing JInternalFrame JInternalFrame
public JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
JInternalFrame
with the specified title, resizability, closability, maximizability, and iconifiability. From source file:flow.visibility.FlowMain.java
public static void main(String[] args) throws Exception { /************************************************************** * Creating the Main GUI //from w ww. ja v a2s .c om **************************************************************/ final JDesktopPane desktop = new JDesktopPane(); final JMenuBar mb = new JMenuBar(); JMenu menu; /** Add File Menu to Open File and Save Result */ menu = new JMenu("File"); JMenuItem Open = new JMenuItem("Open"); JMenuItem Save = new JMenuItem("Save"); menu.add(Open); menu.add(Save); menu.addSeparator(); JMenuItem Exit = new JMenuItem("Exit"); menu.add(Exit); Exit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.exit(0); } }); mb.add(menu); /** Add Control Menu to Start and Stop Capture */ menu = new JMenu("Control"); JMenuItem Start = new JMenuItem("Start Capture"); JMenuItem Stop = new JMenuItem("Stop Capture"); menu.add(Start); Start.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FlowDumper.main(false); } }); menu.add(Stop); Stop.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FlowDumper.main(true); } }); mb.add(menu); /** Add Configuration Menu for Tapping and Display */ menu = new JMenu("Configuration"); JMenuItem Tapping = new JMenuItem("Tapping Configuration"); JMenuItem Display = new JMenuItem("Display Configuration"); menu.add(Tapping); Tapping.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { FlowTapping.main(null); } }); menu.add(Display); mb.add(menu); /** Add Detail Menu for NetGrok Visualization and JEthereal Inspection */ menu = new JMenu("Flow Detail"); JMenuItem FlowVisual = new JMenuItem("Flow Visualization"); JMenuItem FlowInspect = new JMenuItem("Flow Inspections"); menu.add(FlowVisual); FlowVisual.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { NetworkView.main(null); } }); menu.add(FlowInspect); FlowInspect.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Ethereal.main(null); } }); mb.add(menu); /** Add Help Menu for Software Information */ menu = new JMenu("Help"); JMenuItem About = new JMenuItem("About"); menu.add(About); About.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(null, "OF@TEIN Flow Visibility Tools @ 2015 by GIST", "About the Software", JOptionPane.PLAIN_MESSAGE); } }); mb.add(menu); /** Creating the main frame */ JFrame frame = new JFrame("OF@TEIN Flow Visibility Tools"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(desktop); frame.setJMenuBar(mb); frame.setSize(1215, 720); frame.setLocationRelativeTo(null); frame.setVisible(true); /**Add Blank three (3) Internal Jframe*/ /**Internal Frame from Flow Summary Chart*/ JInternalFrame FlowStatistic = new JInternalFrame("Flow Statistic", true, true, true, true); FlowStatistic.setBounds(0, 0, 600, 330); ChartPanel chartPanel = new ChartPanel(createChart(null)); chartPanel.setMouseZoomable(true, false); FlowStatistic.add(chartPanel); FlowStatistic.setVisible(true); desktop.add(FlowStatistic); /**Internal Frame from Flow Summary Text*/ JInternalFrame FlowSummary = new JInternalFrame("Flow Summary", true, true, true, true); FlowSummary.setBounds(0, 331, 600, 329); JTextArea textArea = new JTextArea(50, 10); JScrollPane scrollPane = new JScrollPane(textArea); FlowSummary.add(scrollPane); FlowSummary.setVisible(true); desktop.add(FlowSummary); //JInternalFrame FlowInspection = new JInternalFrame("Flow Inspection", true, true, true, true); //FlowInspection.setBounds(601, 0, 600, 660); //JTextArea textArea2 = new JTextArea(50, 10); //JScrollPane scrollPane2 = new JScrollPane(textArea2); //FlowInspection.add(scrollPane2); //FlowInspection.setVisible(true); //desktop.add(FlowInspection); /**Internal Frame from Printing the Packet Sequence*/ JInternalFrame FlowSequence = new JInternalFrame("Flow Sequence", true, true, true, true); FlowSequence.setBounds(601, 0, 600, 660); JTextArea textArea3 = new JTextArea(50, 10); JScrollPane scrollPane3 = new JScrollPane(textArea3); FlowSequence.add(scrollPane3); FlowSequence.setVisible(true); desktop.add(FlowSequence); /************************************************************** * Update the Frame Regularly **************************************************************/ /** Regularly update the Frame Content every 3 seconds */ for (;;) { desktop.removeAll(); desktop.add(FlowProcess.FlowStatistic()); desktop.add(FlowProcess.FlowSummary()); //desktop.add(FlowProcess.FlowInspection()); desktop.add(FlowProcess.FlowSequence()); desktop.revalidate(); Thread.sleep(10000); } }
From source file:Main.java
public Main() { JInternalFrame frame1 = new JInternalFrame("Frame 1", true, true, true, true); JInternalFrame frame2 = new JInternalFrame("Frame 2", true, true, true, true); frame1.getContentPane().add(new JLabel("Frame 1 contents...")); frame1.pack();//from w w w . j a v a2 s. c o m frame1.setVisible(true); frame2.getContentPane().add(new JLabel("Frame 2 contents...")); frame2.pack(); frame2.setVisible(true); int x2 = frame1.getX() + frame1.getWidth() + 10; int y2 = frame1.getY(); frame2.setLocation(x2, y2); desktopPane.add(frame1); desktopPane.add(frame2); this.add(desktopPane, BorderLayout.CENTER); this.setMinimumSize(new Dimension(300, 300)); }
From source file:Figure3.java
private void addFrame(int number) { JInternalFrame f = new JInternalFrame("Frame " + number, true, true, true, true); f.setBounds(number * 10 - 5, number * 10 - 5, 250, 150); desk.add(f, 1);//from w w w . j av a2 s . co m f.setVisible(true); }
From source file:SimpleInternalFrame.java
public SimpleInternalFrame() { super(""); setSize(500, 400);/*w ww . j av a2 s .c om*/ desktop = new JDesktopPane(); desktop.setOpaque(true); add(desktop, BorderLayout.CENTER); internalFrame = new JInternalFrame("Meow", true, true, true, true); internalFrame.setBounds(50, 50, 200, 100); internalFrame.getContentPane().add(new JLabel(new ImageIcon("1.jpg"))); internalFrame.setVisible(true); desktop.add(internalFrame, new Integer(1)); }
From source file:Main.java
public Main() { JMenuBar bar = new JMenuBar(); JMenu addMenu = new JMenu("Add"); JMenuItem newFrame = new JMenuItem("Internal Frame"); addMenu.add(newFrame);/*from www .j a v a 2 s .c o m*/ bar.add(addMenu); setJMenuBar(bar); final JDesktopPane theDesktop = new JDesktopPane(); getContentPane().add(theDesktop); newFrame.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JInternalFrame frame = new JInternalFrame("Internal Frame", true, true, true, true); Container c = frame.getContentPane(); MyJPanel panel = new MyJPanel(); c.add(panel, BorderLayout.CENTER); frame.setSize(200, 200); frame.setOpaque(true); theDesktop.add(frame); } }); setSize(500, 400); setVisible(true); }
From source file:Main.java
public Main() { super("Focus Example"); setDefaultCloseOperation(EXIT_ON_CLOSE); MyPanel mypanel = new MyPanel(); JButton button1 = new JButton("One"); JButton button2 = new JButton("Two"); JButton button3 = new JButton("Three"); JButton button4 = new JButton("Four"); JButton button5 = new MyButton("Five*"); JButton button6 = new MyButton("Six*"); JButton button7 = new JButton("Seven"); mypanel.add(button2);/*from w w w.j a v a2s . c o m*/ mypanel.add(button3); JInternalFrame frame1 = new JInternalFrame("Internal Frame 1", true, true, true, true); frame1.setBackground(Color.lightGray); frame1.getContentPane().setLayout(new GridLayout(2, 3)); frame1.setSize(300, 200); frame1.getContentPane().add(button1); frame1.getContentPane().add(mypanel); frame1.getContentPane().add(button4); frame1.getContentPane().add(button5); frame1.getContentPane().add(button6); frame1.getContentPane().add(button7); JDesktopPane desktop = new JDesktopPane(); desktop.add(frame1, new Integer(1)); desktop.setOpaque(true); // Now set up the user interface window. Container contentPane = getContentPane(); contentPane.add(desktop, BorderLayout.CENTER); setSize(new Dimension(400, 300)); frame1.setVisible(true); setVisible(true); }
From source file:MainClass.java
public MainClass() { super("Focus Example"); setDefaultCloseOperation(EXIT_ON_CLOSE); MyPanel mypanel = new MyPanel(); JButton button1 = new JButton("One"); JButton button2 = new JButton("Two"); JButton button3 = new JButton("Three"); JButton button4 = new JButton("Four"); JButton button5 = new MyButton("Five*"); JButton button6 = new MyButton("Six*"); JButton button7 = new JButton("Seven"); mypanel.add(button2);/* ww w . j a va2s . c o m*/ mypanel.add(button3); JInternalFrame frame1 = new JInternalFrame("Internal Frame 1", true, true, true, true); frame1.setBackground(Color.lightGray); frame1.getContentPane().setLayout(new GridLayout(2, 3)); frame1.setSize(300, 200); frame1.getContentPane().add(button1); frame1.getContentPane().add(mypanel); frame1.getContentPane().add(button4); frame1.getContentPane().add(button5); frame1.getContentPane().add(button6); frame1.getContentPane().add(button7); JDesktopPane desktop = new JDesktopPane(); desktop.add(frame1, new Integer(1)); desktop.setOpaque(true); // Now set up the user interface window. Container contentPane = getContentPane(); contentPane.add(desktop, BorderLayout.CENTER); setSize(new Dimension(400, 300)); frame1.setVisible(true); setVisible(true); }
From source file:FocusExample.java
public FocusExample() { super("Focus Example"); setDefaultCloseOperation(EXIT_ON_CLOSE); MyPanel mypanel = new MyPanel(); JButton button1 = new JButton("One"); JButton button2 = new JButton("Two"); JButton button3 = new JButton("Three"); JButton button4 = new JButton("Four"); JButton button5 = new MyButton("Five*"); JButton button6 = new MyButton("Six*"); JButton button7 = new JButton("Seven"); mypanel.add(button2);//from www . ja v a2 s.c om mypanel.add(button3); JInternalFrame frame1 = new JInternalFrame("Internal Frame 1", true, true, true, true); frame1.setBackground(Color.lightGray); frame1.getContentPane().setLayout(new GridLayout(2, 3)); frame1.setSize(300, 200); frame1.getContentPane().add(button1); frame1.getContentPane().add(mypanel); frame1.getContentPane().add(button4); frame1.getContentPane().add(button5); frame1.getContentPane().add(button6); frame1.getContentPane().add(button7); JDesktopPane desktop = new JDesktopPane(); desktop.add(frame1, new Integer(1)); desktop.setOpaque(true); // Now set up the user interface window. Container contentPane = getContentPane(); contentPane.add(desktop, BorderLayout.CENTER); setSize(new Dimension(400, 300)); frame1.setVisible(true); setVisible(true); }
From source file:com.chris.brkopani.gui.analytics.Graph.java
public void createAndShowGui(JDesktopPane desk) throws SQLException { //? tabed pane ? WebLookAndFeel.install();//from www . java 2s . c o m frame = new JInternalFrame("PieChart", true, true, true, true); frame.setFrameIcon(new ImageIcon("res/br.png")); frame.setBounds(530, 5, 520, 350); frame.getContentPane().getBackground(); // This will create the dataset PieDataset dataset = createDataset(); // based on the dataset we create the chart JFreeChart chart = createChart(dataset, "PieChart"); // we put the chart into a panel ChartPanel chartPanel = new ChartPanel(chart); chart.setBackgroundPaint(Color.GRAY); // default size chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); // add it to our application frame.add(chartPanel); frame.setVisible(true); desk.add(frame); }
From source file:CascadeDemo.java
public void newFrame() { JInternalFrame jif = new JInternalFrame("Frame " + m_count, true, true, true, true); jif.setBounds(20 * (m_count % 10) + m_tencount * 80, 20 * (m_count % 10), 200, 200); JLabel label = new JLabel(EARTH); jif.getContentPane().add(new JScrollPane(label)); m_desktop.add(jif);//w w w . j a v a 2s . c o m try { jif.setSelected(true); } catch (PropertyVetoException pve) { System.out.println("Could not select " + jif.getTitle()); } m_count++; if (m_count % 10 == 0) { if (m_tencount < 3) m_tencount++; else m_tencount = 0; } }