Example usage for java.awt GridLayout GridLayout

List of usage examples for java.awt GridLayout GridLayout

Introduction

In this page you can find the example usage for java.awt GridLayout GridLayout.

Prototype

public GridLayout(int rows, int cols) 

Source Link

Document

Creates a grid layout with the specified number of rows and columns.

Usage

From source file:LamePrintThread.java

public void init() {
    //Create the text area and make it uneditable.
    display = new TextArea(1, 80);
    display.setEditable(false);/*w w  w .  ja v  a2 s  . com*/

    //Set the layout manager so that the text area
    //will be as wide as possible.
    setLayout(new GridLayout(1, 0));

    //Add the text area to the applet.
    add(display);

    //Find the platform-dependent newline character.
    newline = System.getProperty("line.separator");
    addItem("init: " + threadInfo(Thread.currentThread()));
}

From source file:SpinnerTest.java

public SpinnerFrame() {
    setTitle("SpinnerTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
    JPanel buttonPanel = new JPanel();
    okButton = new JButton("Ok");
    buttonPanel.add(okButton);//from w  w  w . jav  a2s . co  m
    add(buttonPanel, BorderLayout.SOUTH);

    mainPanel = new JPanel();
    mainPanel.setLayout(new GridLayout(0, 3));
    add(mainPanel, BorderLayout.CENTER);

    JSpinner defaultSpinner = new JSpinner();
    addRow("Default", defaultSpinner);

    JSpinner boundedSpinner = new JSpinner(new SpinnerNumberModel(5, 0, 10, 0.5));
    addRow("Bounded", boundedSpinner);

    String[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();

    JSpinner listSpinner = new JSpinner(new SpinnerListModel(fonts));
    addRow("List", listSpinner);

    JSpinner reverseListSpinner = new JSpinner(new SpinnerListModel(fonts) {
        public Object getNextValue() {
            return super.getPreviousValue();
        }

        public Object getPreviousValue() {
            return super.getNextValue();
        }
    });
    addRow("Reverse List", reverseListSpinner);

    JSpinner dateSpinner = new JSpinner(new SpinnerDateModel());
    addRow("Date", dateSpinner);

    JSpinner betterDateSpinner = new JSpinner(new SpinnerDateModel());
    String pattern = ((SimpleDateFormat) DateFormat.getDateInstance()).toPattern();
    betterDateSpinner.setEditor(new JSpinner.DateEditor(betterDateSpinner, pattern));
    addRow("Better Date", betterDateSpinner);

    JSpinner timeSpinner = new JSpinner(new SpinnerDateModel());
    pattern = ((SimpleDateFormat) DateFormat.getTimeInstance(DateFormat.SHORT)).toPattern();
    timeSpinner.setEditor(new JSpinner.DateEditor(timeSpinner, pattern));
    addRow("Time", timeSpinner);

    JSpinner permSpinner = new JSpinner(new PermutationSpinnerModel("meat"));
    addRow("Word permutations", permSpinner);
}

From source file:net.nosleep.superanalyzer.analysis.views.SummaryView.java

private void createPanel() {

    _gridPanel = new JPanel(new GridLayout(19, 2));
    _gridPanel.setOpaque(false);//from   ww  w.  ja va  2s . c o  m

    _statPairs = createStatPairs(_analysis);

    for (int i = 0; i < _statPairs.size(); i++)
        addStatTriple(_gridPanel, _statPairs.elementAt(i));
}

From source file:org.csml.tommo.sugar.modules.heatmap.MappingQualityDialog.java

public MappingQualityDialog(int row, int col, MappingQualityTable table) {
    super(SugarApplication.getApplication());
    initData(row, col, table);/*ww  w  .j  a v a2 s . c  o m*/

    List<TileCoordinates> tileCoordinateList = table.getTileCoordinateList(row, col);
    int colSpan = col == table.getColumnCount() - 1 ? 1 : 2;
    int rowSpan = tileCoordinateList.size() / colSpan;
    centerPanel = new JPanel(new GridLayout(rowSpan, colSpan));
    setLayout(new BorderLayout());
    rebuild();
    add(centerPanel, BorderLayout.CENTER);
    setLocation(400, 350);
    setSize(250 * colSpan, 250 * rowSpan);
}

From source file:com.bright.json.JSonRequestor.java

public static void main(String[] args) {
    String fileBasename = null;//  ww w.  j  a v a 2  s .  com
    String[] zipArgs = null;
    JFileChooser chooser = new JFileChooser("/Users/panos/STR_GRID");
    try {

        chooser.setCurrentDirectory(new java.io.File("."));
        chooser.setDialogTitle("Select the input directory");

        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setAcceptAllFileFilterUsed(false);

        if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
            System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory());
            System.out.println("getSelectedFile() : " + chooser.getSelectedFile());

            // String fileBasename =
            // chooser.getSelectedFile().toString().substring(chooser.getSelectedFile().toString().lastIndexOf(File.separator)+1,chooser.getSelectedFile().toString().lastIndexOf("."));
            fileBasename = chooser.getSelectedFile().toString()
                    .substring(chooser.getSelectedFile().toString().lastIndexOf(File.separator) + 1);
            System.out.println("Base name: " + fileBasename);

            zipArgs = new String[] { chooser.getSelectedFile().toString(),
                    chooser.getCurrentDirectory().toString() + File.separator + fileBasename + ".zip" };
            com.bright.utils.ZipFile.main(zipArgs);

        } else {
            System.out.println("No Selection ");

        }
    } catch (Exception e) {

        System.out.println(e.toString());

    }

    JTextField uiHost = new JTextField("ucs-head.brightcomputing.com");
    // TextPrompt puiHost = new
    // TextPrompt("hadoop.brightcomputing.com",uiHost);
    JTextField uiUser = new JTextField("nexus");
    // TextPrompt puiUser = new TextPrompt("nexus", uiUser);
    JTextField uiPass = new JPasswordField("system");
    // TextPrompt puiPass = new TextPrompt("", uiPass);
    JTextField uiWdir = new JTextField("/home/nexus/pp1234");
    // TextPrompt puiWdir = new TextPrompt("/home/nexus/nexus_workdir",
    // uiWdir);
    JTextField uiOut = new JTextField("foo");
    // TextPrompt puiOut = new TextPrompt("foobar123", uiOut);

    JPanel myPanel = new JPanel(new GridLayout(5, 1));
    myPanel.add(new JLabel("Bright HeadNode hostname:"));
    myPanel.add(uiHost);
    // myPanel.add(Box.createHorizontalStrut(1)); // a spacer
    myPanel.add(new JLabel("Username:"));
    myPanel.add(uiUser);
    myPanel.add(new JLabel("Password:"));
    myPanel.add(uiPass);
    myPanel.add(new JLabel("Working Directory:"));
    myPanel.add(uiWdir);
    // myPanel.add(Box.createHorizontalStrut(1)); // a spacer
    myPanel.add(new JLabel("Output Study Name ( -s ):"));
    myPanel.add(uiOut);

    int result = JOptionPane.showConfirmDialog(null, myPanel, "Please fill in all the fields.",
            JOptionPane.OK_CANCEL_OPTION);
    if (result == JOptionPane.OK_OPTION) {
        System.out.println("Input received.");

    }

    String rfile = uiWdir.getText();
    String rhost = uiHost.getText();
    String ruser = uiUser.getText();
    String rpass = uiPass.getText();
    String nexusOut = uiOut.getText();

    String[] myarg = new String[] { zipArgs[1], ruser + "@" + rhost + ":" + rfile, nexusOut, fileBasename };
    com.bright.utils.ScpTo.main(myarg);

    String cmURL = "https://" + rhost + ":8081/json";
    List<Cookie> cookies = doLogin(ruser, rpass, cmURL);
    chkVersion(cmURL, cookies);

    jobSubmit myjob = new jobSubmit();
    jobSubmit.jobObject myjobObj = new jobSubmit.jobObject();

    myjob.setService("cmjob");
    myjob.setCall("submitJob");

    myjobObj.setQueue("defq");
    myjobObj.setJobname("myNexusJob");
    myjobObj.setAccount(ruser);
    myjobObj.setRundirectory(rfile);
    myjobObj.setUsername(ruser);
    myjobObj.setGroupname("cmsupport");
    myjobObj.setPriority("1");
    myjobObj.setStdinfile(rfile + "/stdin-mpi");
    myjobObj.setStdoutfile(rfile + "/stdout-mpi");
    myjobObj.setStderrfile(rfile + "/stderr-mpi");
    myjobObj.setResourceList(Arrays.asList(""));
    myjobObj.setDependencies(Arrays.asList(""));
    myjobObj.setMailNotify(false);
    myjobObj.setMailOptions("ALL");
    myjobObj.setMaxWallClock("00:10:00");
    myjobObj.setNumberOfProcesses(1);
    myjobObj.setNumberOfNodes(1);
    myjobObj.setNodes(Arrays.asList(""));
    myjobObj.setCommandLineInterpreter("/bin/bash");
    myjobObj.setUserdefined(Arrays.asList("cd " + rfile, "date", "pwd"));
    myjobObj.setExecutable("mpirun");
    myjobObj.setArguments("-env I_MPI_FABRICS shm:tcp " + Constants.NEXUSSIM_EXEC + " -mpi -c " + rfile + "/"
            + fileBasename + "/" + fileBasename + " -s " + rfile + "/" + fileBasename + "/" + nexusOut);
    myjobObj.setModules(Arrays.asList("shared", "nexus", "intel-mpi/64"));
    myjobObj.setDebug(false);
    myjobObj.setBaseType("Job");
    myjobObj.setIsSlurm(true);
    myjobObj.setUniqueKey(0);
    myjobObj.setModified(false);
    myjobObj.setToBeRemoved(false);
    myjobObj.setChildType("SlurmJob");
    myjobObj.setJobID("Nexus test");

    // Map<String,jobSubmit.jobObject > mymap= new HashMap<String,
    // jobSubmit.jobObject>();
    // mymap.put("Slurm",myjobObj);
    ArrayList<Object> mylist = new ArrayList<Object>();
    mylist.add("slurm");
    mylist.add(myjobObj);
    myjob.setArgs(mylist);

    GsonBuilder builder = new GsonBuilder();
    builder.enableComplexMapKeySerialization();

    // Gson g = new Gson();
    Gson g = builder.create();

    String json2 = g.toJson(myjob);

    // To be used from a real console and not Eclipse
    Delete.main(zipArgs[1]);
    String message = JSonRequestor.doRequest(json2, cmURL, cookies);
    @SuppressWarnings("resource")
    Scanner resInt = new Scanner(message).useDelimiter("[^0-9]+");
    int jobID = resInt.nextInt();
    System.out.println("Job ID: " + jobID);

    JOptionPane optionPane = new JOptionPane(message);
    JDialog myDialog = optionPane.createDialog(null, "CMDaemon response: ");
    myDialog.setModal(false);
    myDialog.setVisible(true);

    ArrayList<Object> mylist2 = new ArrayList<Object>();
    mylist2.add("slurm");
    String JobID = Integer.toString(jobID);
    mylist2.add(JobID);
    myjob.setArgs(mylist2);
    myjob.setService("cmjob");
    myjob.setCall("getJob");
    String json3 = g.toJson(myjob);
    System.out.println("JSON Request No. 4 " + json3);

    cmReadFile readfile = new cmReadFile();
    readfile.setService("cmmain");
    readfile.setCall("readFile");
    readfile.setUserName(ruser);

    int fileByteIdx = 1;

    readfile.setPath(rfile + "/" + fileBasename + "/" + fileBasename + ".sum@+" + fileByteIdx);
    String json4 = g.toJson(readfile);

    String monFile = JSonRequestor.doRequest(json4, cmURL, cookies).replaceAll("^\"|\"$", "");
    if (monFile.startsWith("Unable")) {
        monFile = "";
    } else {
        fileByteIdx += countLines(monFile, "\\\\n");
        System.out.println("");
    }

    StringBuffer output = new StringBuffer();
    // Get the correct Line Separator for the OS (CRLF or LF)
    String nl = System.getProperty("line.separator");
    String filename = chooser.getCurrentDirectory().toString() + File.separator + fileBasename + ".sum.txt";
    System.out.println("Local monitoring file: " + filename);

    output.append(monFile.replaceAll("\\\\n", System.getProperty("line.separator")));

    String getJobJSON = JSonRequestor.doRequest(json3, cmURL, cookies);
    jobGet getJobObj = new Gson().fromJson(getJobJSON, jobGet.class);
    System.out.println("Job " + jobID + " status: " + getJobObj.getStatus().toString());

    while (getJobObj.getStatus().toString().equals("RUNNING")
            || getJobObj.getStatus().toString().equals("COMPLETING")) {
        try {

            getJobJSON = JSonRequestor.doRequest(json3, cmURL, cookies);
            getJobObj = new Gson().fromJson(getJobJSON, jobGet.class);
            System.out.println("Job " + jobID + " status: " + getJobObj.getStatus().toString());

            readfile.setPath(rfile + "/" + fileBasename + "/" + fileBasename + ".sum@+" + fileByteIdx);
            json4 = g.toJson(readfile);
            monFile = JSonRequestor.doRequest(json4, cmURL, cookies).replaceAll("^\"|\"$", "");
            if (monFile.startsWith("Unable")) {
                monFile = "";
            } else {

                output.append(monFile.replaceAll("\\\\n", System.getProperty("line.separator")));
                System.out.println("FILE INDEX:" + fileByteIdx);
                fileByteIdx += countLines(monFile, "\\\\n");
            }
            Thread.sleep(Constants.STATUS_CHECK_INTERVAL);
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
        }

    }

    Gson gson_nice = new GsonBuilder().setPrettyPrinting().create();
    String json_out = gson_nice.toJson(getJobJSON);
    System.out.println(json_out);
    System.out.println("JSON Request No. 5 " + json4);

    readfile.setPath(rfile + "/" + fileBasename + "/" + fileBasename + ".sum@+" + fileByteIdx);
    json4 = g.toJson(readfile);
    monFile = JSonRequestor.doRequest(json4, cmURL, cookies).replaceAll("^\"|\"$", "");
    if (monFile.startsWith("Unable")) {
        monFile = "";
    } else {

        output.append(monFile.replaceAll("\\\\n", System.getProperty("line.separator")));
        fileByteIdx += countLines(monFile, "\\\\n");
    }
    System.out.println("FILE INDEX:" + fileByteIdx);

    /*
     * System.out.print("Monitoring file: " + monFile.replaceAll("\\n",
     * System.getProperty("line.separator"))); try {
     * FileUtils.writeStringToFile( new
     * File(chooser.getCurrentDirectory().toString() + File.separator +
     * fileBasename + ".sum.txt"), monFile.replaceAll("\\n",
     * System.getProperty("line.separator"))); } catch (IOException e) {
     * 
     * e.printStackTrace(); }
     */

    if (getJobObj.getStatus().toString().equals("COMPLETED")) {
        String[] zipArgs_from = new String[] { chooser.getSelectedFile().toString(),
                chooser.getCurrentDirectory().toString() + File.separator + fileBasename + "_out.zip" };
        String[] myarg_from = new String[] {
                ruser + "@" + rhost + ":" + rfile + "/" + fileBasename + "_out.zip", zipArgs_from[1], rfile,
                fileBasename };
        com.bright.utils.ScpFrom.main(myarg_from);

        JOptionPane optionPaneS = new JOptionPane("Job execution completed without errors!");
        JDialog myDialogS = optionPaneS.createDialog(null, "Job status: ");
        myDialogS.setModal(false);
        myDialogS.setVisible(true);

    } else {
        JOptionPane optionPaneF = new JOptionPane("Job execution FAILED!");
        JDialog myDialogF = optionPaneF.createDialog(null, "Job status: ");
        myDialogF.setModal(false);
        myDialogF.setVisible(true);
    }

    try {
        System.out.println("Local monitoring file: " + filename);

        BufferedWriter out = new BufferedWriter(new FileWriter(filename));
        String outText = output.toString();
        String newString = outText.replace("\\\\n", nl);

        System.out.println("Text: " + outText);
        out.write(newString);

        out.close();
        rmDuplicateLines.main(filename);
    } catch (IOException e) {
        e.printStackTrace();
    }
    doLogout(cmURL, cookies);
    System.exit(0);
}

From source file:com.emental.mindraider.ui.dialogs.NewRdfModelJDialog.java

/**
 * Constructor./*from   www  .  ja v  a 2s  .  c  o  m*/
 */
public NewRdfModelJDialog() {

    super(Messages.getString("NewRdfModelJDialog.title"));

    JPanel framePanel = new JPanel();
    framePanel.setLayout(new GridLayout(3, 1));

    JPanel p = new JPanel();
    p.setLayout(new FlowLayout(FlowLayout.RIGHT));
    p.add(new JLabel(Messages.getString("NewRdfModelJDialog.subject")));

    subjectNs = new JTextField(30);
    subjectNs.setText(MindRaiderConstants.MR_RDF_PREDICATE_NS);
    p.add(subjectNs);
    p.add(new JLabel("#"));

    subjectLocalName = new JTextField(15);
    p.add(subjectLocalName);
    framePanel.add(p);

    p = new JPanel();
    p.setLayout(new FlowLayout(FlowLayout.RIGHT));
    final JCheckBox literalCheckBox = new JCheckBox("literal", false);
    p.add(literalCheckBox);
    framePanel.add(p);

    p = new JPanel();
    p.setLayout(new FlowLayout(FlowLayout.CENTER));
    JButton addButton = new JButton(Messages.getString("NewRdfModelJDialog.create"));
    p.add(addButton);
    addButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            createModel(literalCheckBox);
        }
    });

    JButton cancelButton = new JButton(Messages.getString("NewRdfModelJDialog.cancel"));
    p.add(cancelButton);
    cancelButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            NewRdfModelJDialog.this.dispose();
        }
    });
    framePanel.add(p);

    subjectLocalName.addKeyListener(new KeyListener() {

        public void keyPressed(KeyEvent keyEvent) {
            if (keyEvent.getKeyCode() == KeyEvent.VK_ENTER) {
                createModel(literalCheckBox);
            }
        }

        public void keyReleased(KeyEvent keyEvent) {
        }

        public void keyTyped(KeyEvent keyEvent) {
        }
    });

    getContentPane().add(framePanel, BorderLayout.CENTER);

    // show
    pack();
    Gfx.centerAndShowWindow(this);

    addWindowListener(new WindowAdapter() {

        public void windowActivated(WindowEvent e) {
            subjectLocalName.requestFocusInWindow();
        }
    });
}

From source file:BorderDemo.java

public BorderDemo() {
    super(new GridLayout(1, 0));

    // Keep references to the next few borders,
    // for use in titles and compound borders.
    Border blackline, raisedetched, loweredetched, raisedbevel, loweredbevel, empty;

    // A border that puts 10 extra pixels at the sides and
    // bottom of each pane.
    Border paneEdge = BorderFactory.createEmptyBorder(0, 10, 10, 10);

    blackline = BorderFactory.createLineBorder(Color.black);
    raisedetched = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
    loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    raisedbevel = BorderFactory.createRaisedBevelBorder();
    loweredbevel = BorderFactory.createLoweredBevelBorder();
    empty = BorderFactory.createEmptyBorder();

    // First pane: simple borders
    JPanel simpleBorders = new JPanel();
    simpleBorders.setBorder(paneEdge);/*from w  w w.  ja v a  2 s .  c  o  m*/
    simpleBorders.setLayout(new BoxLayout(simpleBorders, BoxLayout.Y_AXIS));

    addCompForBorder(blackline, "line border", simpleBorders);
    addCompForBorder(raisedetched, "raised etched border", simpleBorders);
    addCompForBorder(loweredetched, "lowered etched border", simpleBorders);
    addCompForBorder(raisedbevel, "raised bevel border", simpleBorders);
    addCompForBorder(loweredbevel, "lowered bevel border", simpleBorders);
    addCompForBorder(empty, "empty border", simpleBorders);

    // Second pane: matte borders
    JPanel matteBorders = new JPanel();
    matteBorders.setBorder(paneEdge);
    matteBorders.setLayout(new BoxLayout(matteBorders, BoxLayout.Y_AXIS));

    ImageIcon icon = createImageIcon("images/wavy.gif", "wavy-line border icon"); // 20x22
    Border border = BorderFactory.createMatteBorder(-1, -1, -1, -1, icon);
    if (icon != null) {
        addCompForBorder(border, "matte border (-1,-1,-1,-1,icon)", matteBorders);
    } else {
        addCompForBorder(border, "matte border (-1,-1,-1,-1,<null-icon>)", matteBorders);
    }
    border = BorderFactory.createMatteBorder(1, 5, 1, 1, Color.red);
    addCompForBorder(border, "matte border (1,5,1,1,Color.red)", matteBorders);

    border = BorderFactory.createMatteBorder(0, 20, 0, 0, icon);
    if (icon != null) {
        addCompForBorder(border, "matte border (0,20,0,0,icon)", matteBorders);
    } else {
        addCompForBorder(border, "matte border (0,20,0,0,<null-icon>)", matteBorders);
    }

    // Third pane: titled borders
    JPanel titledBorders = new JPanel();
    titledBorders.setBorder(paneEdge);
    titledBorders.setLayout(new BoxLayout(titledBorders, BoxLayout.Y_AXIS));
    TitledBorder titled;

    titled = BorderFactory.createTitledBorder("title");
    addCompForBorder(titled, "default titled border" + " (default just., default pos.)", titledBorders);

    titled = BorderFactory.createTitledBorder(blackline, "title");
    addCompForTitledBorder(titled, "titled line border" + " (centered, default pos.)", TitledBorder.CENTER,
            TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(loweredetched, "title");
    addCompForTitledBorder(titled, "titled lowered etched border" + " (right just., default pos.)",
            TitledBorder.RIGHT, TitledBorder.DEFAULT_POSITION, titledBorders);

    titled = BorderFactory.createTitledBorder(loweredbevel, "title");
    addCompForTitledBorder(titled, "titled lowered bevel border" + " (default just., above top)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.ABOVE_TOP, titledBorders);

    titled = BorderFactory.createTitledBorder(empty, "title");
    addCompForTitledBorder(titled, "titled empty border" + " (default just., bottom)",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.BOTTOM, titledBorders);

    // Fourth pane: compound borders
    JPanel compoundBorders = new JPanel();
    compoundBorders.setBorder(paneEdge);
    compoundBorders.setLayout(new BoxLayout(compoundBorders, BoxLayout.Y_AXIS));
    Border redline = BorderFactory.createLineBorder(Color.red);

    Border compound;
    compound = BorderFactory.createCompoundBorder(raisedbevel, loweredbevel);
    addCompForBorder(compound, "compound border (two bevels)", compoundBorders);

    compound = BorderFactory.createCompoundBorder(redline, compound);
    addCompForBorder(compound, "compound border (add a red outline)", compoundBorders);

    titled = BorderFactory.createTitledBorder(compound, "title", TitledBorder.CENTER,
            TitledBorder.BELOW_BOTTOM);
    addCompForBorder(titled, "titled compound border" + " (centered, below bottom)", compoundBorders);

    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("Simple", null, simpleBorders, null);
    tabbedPane.addTab("Matte", null, matteBorders, null);
    tabbedPane.addTab("Titled", null, titledBorders, null);
    tabbedPane.addTab("Compound", null, compoundBorders, null);
    tabbedPane.setSelectedIndex(0);
    String toolTip = new String(
            "<html>Blue Wavy Line border art crew:<br>&nbsp;&nbsp;&nbsp;Bill Pauley<br>&nbsp;&nbsp;&nbsp;Cris St. Aubyn<br>&nbsp;&nbsp;&nbsp;Ben Wronsky<br>&nbsp;&nbsp;&nbsp;Nathan Walrath<br>&nbsp;&nbsp;&nbsp;Tommy Adams, special consultant</html>");
    tabbedPane.setToolTipTextAt(1, toolTip);

    add(tabbedPane);
}

From source file:StrokeTest.java

public StrokeTestFrame() {
    setTitle("StrokeTest");
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    canvas = new StrokeComponent();
    add(canvas, BorderLayout.CENTER);

    buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(3, 3));
    add(buttonPanel, BorderLayout.NORTH);

    ButtonGroup group1 = new ButtonGroup();
    makeCapButton("Butt Cap", BasicStroke.CAP_BUTT, group1);
    makeCapButton("Round Cap", BasicStroke.CAP_ROUND, group1);
    makeCapButton("Square Cap", BasicStroke.CAP_SQUARE, group1);

    ButtonGroup group2 = new ButtonGroup();
    makeJoinButton("Miter Join", BasicStroke.JOIN_MITER, group2);
    makeJoinButton("Bevel Join", BasicStroke.JOIN_BEVEL, group2);
    makeJoinButton("Round Join", BasicStroke.JOIN_ROUND, group2);

    ButtonGroup group3 = new ButtonGroup();
    makeDashButton("Solid Line", false, group3);
    makeDashButton("Dashed Line", true, group3);
}

From source file:org.encog.workbench.tabs.visualize.scatter.ScatterPlotTab.java

public ScatterPlotTab(EncogAnalyst analyst, String className, List<String> axisList) {
    super(null);//from w  ww .j  a v  a2 s . co m
    this.analyst = analyst;
    this.file = new ScatterFile(this.analyst, className, axisList);

    if (axisList.size() <= 2) {
        this.add(createPanel(0, 1, true));
        return;
    } else {
        JPanel panel = new JPanel();
        int count = axisList.size();
        panel.setLayout(new GridLayout(count, count));

        for (int col = 0; col < count; col++) {
            for (int row = 0; row < count; row++) {
                if (col == row) {
                    panel.add(new ScatterLabelPane(axisList.get(row)));
                } else {
                    panel.add(createPanel(row, col, false));
                }
            }
        }

        this.setLayout(new BorderLayout());
        this.add(panel, BorderLayout.CENTER);
        LegendPanel legend = new LegendPanel(this.samplePlot);
        this.add(legend, BorderLayout.SOUTH);
    }
}

From source file:TableDemo.java

public TableDemo() {
    super(new GridLayout(1, 0));

    JTable table = new JTable(new MyTableModel());
    table.setPreferredScrollableViewportSize(new Dimension(500, 70));

    //Create the scroll pane and add the table to it.
    JScrollPane scrollPane = new JScrollPane(table);

    //Add the scroll pane to this panel.
    add(scrollPane);/*from  w w  w  .  j a  v a 2 s  .  c  om*/
}