List of usage examples for java.awt Container setLayout
public void setLayout(LayoutManager mgr)
From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.css.FerramentaCSSPanel.java
private void criaInterfaceVisualEscalavel() { painel = new JPanel(); painel.setLayout(new GridLayout(2, 1)); textAreaSourceCode = new G_TextAreaSourceCode(); textAreaSourceCode.setBorder(criaBorda(CSSPanel.COD_FONTE)); Container contentPane = this; contentPane.setLayout(new GridLayout(1, 1)); painel.add(textAreaSourceCode);//from www. j a v a 2s . com JPanel panelBtnTabela = new JPanel(); panelBtnTabela.setLayout(new BorderLayout()); /* * Barra de botes */ btnPanel = new JPanel(); btnPanel.setLayout(null); btn_salvar = new JButton(CSSPanel.BTN_SALVAR); btn_salvar.setBounds(10, 0, 100, 25); btnPanel.add(btn_salvar); btn_abrir = new JButton(CSSPanel.BTN_ABRIR); btn_abrir.setBounds(115, 0, 100, 25); btnPanel.add(btn_abrir); btn_salvarComo = new JButton(CSSPanel.BTN_SALVAR_COMO); btn_salvarComo.setBounds(220, 0, 120, 25); btnPanel.add(btn_salvarComo); btnPanel.setPreferredSize(new Dimension(760, 30)); tabelaDeErros = new TabelaErros(erros); String cols[] = { "Url", "Erros", "Avisos" }; int sizes[] = { 0, 60, 60 }; tabelaArq = new G_TableReadOnly(cols, sizes); scrollPaneTabela = new JScrollPane(); scrollPaneTabela.setBorder(criaBorda(CSSPanel.LISTA_ERROS)); scrollPaneTabela.setViewportView(tabelaDeErros); panelBtnTabela.add(btnPanel, BorderLayout.NORTH); panelBtnTabela.add(scrollPaneTabela, BorderLayout.CENTER); painel.add(panelBtnTabela); contentPane.add(painel); if (!original) { reverter = new JButton(TradPainelRelatorio.REVERTER); reverter.setText(TradPainelRelatorio.REVERTER); reverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); reavalia(ferrCSSPanelNaoEditavel.textAreaSourceCode.getText()); } }); // reverter.setActionCommand("Reverter"); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); reverter.setBounds(345, 0, 150, 25); btnPanel.add(reverter); } btnPanel.setBackground(frameSilvinha.corDefault); panelBtnTabela.setBackground(frameSilvinha.corDefault); painel.setBackground(frameSilvinha.corDefault); contentPane.setBackground(frameSilvinha.corDefault); scrollPaneTabela.setBackground(frameSilvinha.corDefault); textAreaSourceCode.setBackground(frameSilvinha.corDefault); this.setVisible(true); }
From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.corretor_eventos.PanelCorretorEventos.java
private void criaInterfaceVisualEscalavel() { miBtnSalvar = new JMenuItem(XHTML_Panel.BTN_SALVAR); painel = new JPanel(); frameSilvinha.setJMenuBar(this.criaMenuBar()); textAreaSourceCode.setTipoHTML();/* ww w. j a va 2 s . co m*/ textAreaSourceCode.setBorder(criaBorda(XHTML_Panel.COD_FONTE)); frameSilvinha.setTitle(XHTML_Panel.TIT_CORR_EVT); painel.setLayout(new GridLayout(2, 1)); setBackground(frameSilvinha.corDefault); Container contentPane = this; contentPane.setLayout(new GridLayout(1, 1)); painel.add(textAreaSourceCode); JPanel panelBtnTabela = new JPanel(); panelBtnTabela.setLayout(new BorderLayout()); /* * Barra de botes */ btnPanel = new JPanel(); btnPanel.setLayout(null); btn_salvar = new JButton(XHTML_Panel.BTN_SALVAR); btn_salvar.setToolTipText(XHTML_Panel.DICA_SALVAR); btn_salvar.setBounds(10, 0, 150, 25); btnPanel.add(btn_salvar); btn_abrir = new JButton(XHTML_Panel.BTN_ABRIR); btn_abrir.setToolTipText(XHTML_Panel.DICA_ABRIR); btn_abrir.setBounds(165, 0, 150, 25); btnPanel.add(btn_abrir); btn_salvarComo = new JButton(XHTML_Panel.BTN_SALVAR_COMO); btn_salvarComo.setToolTipText(XHTML_Panel.DICA_SALVAR_COMO); btn_salvarComo.setBounds(320, 0, 150, 25); btnPanel.add(btn_salvarComo); btn_cancelar = new JButton(XHTML_Panel.TELA_ANTERIOR); btn_cancelar.setToolTipText(XHTML_Panel.DICA_TELA_ANTERIOR); btn_cancelar.setBounds(480, 0, 150, 25); btnPanel.add(btn_cancelar); btnPanel.setPreferredSize(new Dimension(430, 30)); /* * Barra de correcao */ btnAplicar = new JButton(XHTML_Panel.BTN_APLICAR); btnAplicar.setToolTipText(XHTML_Panel.DICA_BTN_APLICAR); btnAplicar.setEnabled(false); texto = new JTextField(); texto.setBorder(BorderFactory.createLineBorder(Color.BLACK)); JPanel borda = new JPanel(new BorderLayout()); lbl_texto = new JLabel("JavaScript: "); lbl_texto.setToolTipText(XHTML_Panel.DICA_JAVASCRIPT); borda.add(lbl_texto, BorderLayout.WEST); borda.add(texto, BorderLayout.CENTER); borda.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); borda.setOpaque(false); panelCorretor = new JPanel(new BorderLayout()); panelCorretor.add(borda, BorderLayout.CENTER); panelCorretor.add(btnAplicar, BorderLayout.EAST); // panelCorretor.add(btnPanel,BorderLayout.WEST); panelCorretor.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); panelCorretor.setOpaque(false); /* * Tabela de erros */ tabelaDeErros = new TabelaErros(); scrollPaneTabela = new JScrollPane(); scrollPaneTabela.setViewportView(tabelaDeErros); panelBtnTabela.add(panelCorretor, BorderLayout.NORTH); panelBtnTabela.add(scrollPaneTabela, BorderLayout.CENTER); panelBtnTabela.add(btnPanel, BorderLayout.SOUTH); scrollPaneTabela.setBorder(criaBorda(XHTML_Panel.LISTA_ERROS)); painel.add(panelBtnTabela); btnPanel.setBackground(frameSilvinha.corDefault); { reverter = new JButton("Reverter"); reverter.setText(TradPainelRelatorio.REVERTER); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); reverter.setBounds(480, 0, 150, 25); btnPanel.add(reverter); reverter = new JButton("Reverter"); reverter.setText(TradPainelRelatorio.REVERTER); reverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); TxtBuffer.setContent(TxtBuffer.getContentOriginal()); frameSilvinha.showPainelFerramentaEventoDependente(); setVisible(true); } }); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); reverter.setBounds(640, 0, 150, 25); btnPanel.add(reverter); } panelBtnTabela.setBackground(frameSilvinha.corDefault); painel.setBackground(frameSilvinha.corDefault); contentPane.setBackground(frameSilvinha.corDefault); scrollPaneTabela.setBackground(frameSilvinha.corDefault); textAreaSourceCode.setBackground(frameSilvinha.corDefault); miBtnSalvar.setEnabled(false); btn_salvar.setEnabled(false); salvaAlteracoes = TxtBuffer.getInstanciaSalvaAlteracoes(textAreaSourceCode.getTextPane(), btn_salvar, miBtnSalvar, frameSilvinha); String fil[] = { ".html", ".htm" }; salvaAlteracoes.setFiltro(fil); contentPane.add(painel); // pack(); this.setVisible(true); }
From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.links_redundantes.PanelLinkRedundante.java
private void criaInterfaceVisualEscalavel() { miBtnSalvar = new JMenuItem(XHTML_Panel.BTN_SALVAR); painel = new JPanel(); textAreaSourceCode = new G_TextAreaSourceCode(); //frameSilvinha.setJMenuBar(this.criaMenuBar()); textAreaSourceCode.setTipoHTML();/* w w w . j a v a2s .c o m*/ textAreaSourceCode.setBorder(criaBorda(XHTML_Panel.COD_FONTE)); //frameSilvinha.setTitle(XHTMLPanel.TIT_LINK_RED); painel.setLayout(new GridLayout(2, 1)); setBackground(frameSilvinha.corDefault); Container contentPane = this; contentPane.setLayout(new GridLayout(1, 1)); painel.add(textAreaSourceCode); JPanel panelBtnTabela = new JPanel(); panelBtnTabela.setLayout(new BorderLayout()); /* * Barra de botes */ btnPanel = new JPanel(); btnPanel.setLayout(null); btn_salvar = new JButton(XHTML_Panel.BTN_SALVAR); btn_salvar.setToolTipText(XHTML_Panel.DICA_SALVAR); btn_salvar.setBounds(10, 0, 150, 25); btnPanel.add(btn_salvar); btn_abrir = new JButton(XHTML_Panel.BTN_ABRIR); btn_abrir.setToolTipText(XHTML_Panel.DICA_ABRIR); btn_abrir.setBounds(165, 0, 150, 25); btnPanel.add(btn_abrir); btn_salvarComo = new JButton(XHTML_Panel.BTN_SALVAR_COMO); btn_salvarComo.setToolTipText(XHTML_Panel.DICA_SALVAR_COMO); btn_salvarComo.setBounds(320, 0, 150, 25); btnPanel.add(btn_salvarComo); btn_cancelar = new JButton(XHTML_Panel.TELA_ANTERIOR); btn_cancelar.setToolTipText(XHTML_Panel.DICA_TELA_ANTERIOR); btn_cancelar.setBounds(480, 0, 150, 25); btnPanel.add(btn_cancelar); btnPanel.setPreferredSize(new Dimension(430, 30)); /* * Barra de correcao */ btnAplicar = new JButton(XHTML_Panel.BTN_APLICAR); btnAplicar.setToolTipText(XHTML_Panel.DICA_BTN_APLICAR); btnAplicar.setEnabled(false); texto = new JTextField(); texto.setBorder(BorderFactory.createLineBorder(Color.BLACK)); JPanel borda = new JPanel(new BorderLayout()); JLabel lbl_texto = new JLabel(XHTML_Panel.ROTULO_TEXTO); lbl_texto.setToolTipText(XHTML_Panel.DICA_ROTULO_TEXTO); borda.add(lbl_texto, BorderLayout.WEST); borda.add(texto, BorderLayout.CENTER); borda.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); borda.setOpaque(false); panelCorretor = new JPanel(new BorderLayout()); panelCorretor.add(borda, BorderLayout.CENTER); panelCorretor.add(btnAplicar, BorderLayout.EAST); //panelCorretor.add(btnPanel,BorderLayout.WEST); panelCorretor.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); panelCorretor.setOpaque(false); /* * Tabela de erros */ tabelaDeErros = new TabelaErros(); scrollPaneTabela = new JScrollPane(); scrollPaneTabela.setViewportView(tabelaDeErros); panelBtnTabela.add(panelCorretor, BorderLayout.NORTH); panelBtnTabela.add(scrollPaneTabela, BorderLayout.CENTER); panelBtnTabela.add(btnPanel, BorderLayout.SOUTH); scrollPaneTabela.setBorder(criaBorda(XHTML_Panel.LISTA_ERROS)); painel.add(panelBtnTabela); btnPanel.setBackground(frameSilvinha.corDefault); if (!original) { reverter = new JButton("Reverter"); reverter.setText(TradPainelRelatorio.REVERTER); reverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub setVisible(false); TxtBuffer.setContent(TxtBuffer.getContentOriginal()); frameSilvinha.showPainelFerramentaLinksRedundantes(); setVisible(true); } }); //reverter.setActionCommand("Reverter"); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); reverter.setBounds(640, 0, 150, 25); btnPanel.add(reverter); } panelBtnTabela.setBackground(frameSilvinha.corDefault); painel.setBackground(frameSilvinha.corDefault); contentPane.setBackground(frameSilvinha.corDefault); scrollPaneTabela.setBackground(frameSilvinha.corDefault); textAreaSourceCode.setBackground(frameSilvinha.corDefault); miBtnSalvar.setEnabled(false); btn_salvar.setEnabled(false); salvaAlteracoes = TxtBuffer.getInstanciaSalvaAlteracoes(textAreaSourceCode.getTextPane(), btn_salvar, miBtnSalvar, frameSilvinha); String fil[] = { ".html", ".htm" }; salvaAlteracoes.setFiltro(fil); contentPane.add(painel); // pack(); this.setVisible(true); }
From source file:fll.subjective.SubjectiveFrame.java
/** * Show differences./*w ww . java 2 s .c o m*/ */ private void showDifferencesDialog(final Collection<SubjectiveScoreDifference> diffs) { final SubjectiveDiffTableModel model = new SubjectiveDiffTableModel(diffs); final JTable table = new JTable(model); table.setGridColor(Color.BLACK); table.addMouseListener(new MouseAdapter() { public void mouseClicked(final MouseEvent e) { if (e.getClickCount() == 2) { final JTable target = (JTable) e.getSource(); final int row = target.getSelectedRow(); final SubjectiveScoreDifference diff = model.getDiffForRow(row); // find correct table final String category = diff.getCategory(); final JTable scoreTable = getTableForTitle(category); final int tabIndex = getTabIndexForCategory(category); getTabbedPane().setSelectedIndex(tabIndex); // get correct row and column final SubjectiveTableModel model = (SubjectiveTableModel) scoreTable.getModel(); final int scoreRow = model.getRowForTeamAndJudge(diff.getTeamNumber(), diff.getJudge()); final int scoreCol = model.getColForSubcategory(diff.getSubcategory()); if (scoreRow == -1 || scoreCol == -1) { throw new FLLRuntimeException( "Internal error: Cannot find correct row and column for score difference: " + diff); } scoreTable.changeSelection(scoreRow, scoreCol, false, false); } } }); final JDialog dialog = new JDialog(this, false); final Container cpane = dialog.getContentPane(); cpane.setLayout(new BorderLayout()); final JScrollPane tableScroller = new JScrollPane(table); cpane.add(tableScroller, BorderLayout.CENTER); dialog.pack(); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setVisible(true); }
From source file:br.org.acessobrasil.ases.ferramentas_de_reparo.vista.doctype.ferramentaDoctype.java
/** * Mtodo chamado pelos construtores/*from w w w.jav a 2 s. c om*/ * * @param conteudo */ private void initComponents(String conteudo) { textAreaSourceCode = new G_TextAreaSourceCode(); tabelaDoctypes = new TabelaDescricao(); aplicar = new JButton(); abrir = new JButton(); cancelar = new JButton(); JPanel regraFonteBtn = new JPanel(); regraFonteBtn.setLayout(new BorderLayout()); textAreaSourceCode.setTipoHTML(); new OnChange(textAreaSourceCode, this); tabelaDoctypes = new TabelaDescricao(); salvar = new JButton(); abrir = new JButton(); cancelar = new JButton(); strConteudoalt = new String(); pnRegra = new JPanel(); lbRegras1 = new JLabel(); pnSetaDescricao = new JPanel(); pnListaErros = new JPanel(); scrollPanetabLinCod = new JScrollPane(); pnBotoes = new JPanel(); buscar = new JButton(); salvar.setEnabled(false); salvaAlteracoes = TxtBuffer.getInstanciaSalvaAlteracoes(textAreaSourceCode.getTextPane(), salvar, new JMenuItem(), parentFrame); textAreaSourceCode.getTextPane().setEditable(true); aplicar.setEnabled(false); setBackground(CoresDefault.getCorPaineis()); Container contentPane = this;// ?? contentPane.setLayout(new GridLayout(2, 1)); // ======== pnRegra ======== { // pnRegra.setBorder(criaBorda("")); pnRegra.setBorder(criaBorda(LabelPanel.TITULO_REGRA)); pnRegra.setLayout(new GridLayout(2, 1)); pnRegra.add(lbRegras1); lbRegras1.setText(TradFerramentaDocType.UTILIZAR_ELEMENTOS_CABECALHO); lbRegras1.setHorizontalAlignment(SwingConstants.CENTER); pnRegra.add(lbRegras1); pnRegra.setPreferredSize(new Dimension(700, 60)); } // ======== pnDescricao ======== aplicar.setText(GERAL.APLICAR); aplicar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { aplicarActionPerformed(e); } }); aplicar.setToolTipText(TradFerramentaDocType.DICA_APLICA_DTD); aplicar.getAccessibleContext().setAccessibleDescription(TradFerramentaDocType.DICA_APLICA_DTD); aplicar.getAccessibleContext().setAccessibleName(TradFerramentaDocType.DICA_APLICA_DTD); aplicar.setBounds(10, 0, 150, 25); salvar.setText(GERAL.BTN_SALVAR); salvar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { salvarActionPerformed(e); } }); salvar.setToolTipText(GERAL.DICA_SALVAR); salvar.getAccessibleContext().setAccessibleDescription(GERAL.DICA_SALVAR); salvar.getAccessibleContext().setAccessibleName(GERAL.DICA_SALVAR); salvar.setBounds(10, 0, 150, 25); abrir.setText(GERAL.BTN_ABRIR); abrir.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { abrirActionPerformed(e); } }); abrir.setToolTipText(Ferramenta_Scripts.DICA_ABRIR); abrir.getAccessibleContext().setAccessibleDescription(Ferramenta_Scripts.DICA_ABRIR_HTML); abrir.getAccessibleContext().setAccessibleName(Ferramenta_Scripts.DICA_ABRIR_HTML); abrir.setBounds(165, 0, 150, 25); cancelar.setText(Ferramenta_Imagens.TELA_ANTERIOR); cancelar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelarActionPerformed(e); } }); cancelar.setToolTipText(Ferramenta_Imagens.DICA_TELA_ANTERIOR); cancelar.getAccessibleContext().setAccessibleDescription(Ferramenta_Imagens.DICA_TELA_ANTERIOR); cancelar.getAccessibleContext().setAccessibleName(Ferramenta_Imagens.DICA_BTN_CANCELAR); cancelar.setBounds(320, 0, 150, 25); // ======== pnParticRotulo ======== // pnSetaDescricao.setBorder(criaBorda("")); GridBagConstraints cons = new GridBagConstraints(); GridBagLayout layout = new GridBagLayout(); cons.fill = GridBagConstraints.BOTH; cons.weighty = 1; cons.weightx = 0.80; pnSetaDescricao.setLayout(layout); cons.anchor = GridBagConstraints.SOUTHEAST; cons.insets = new Insets(0, 0, 0, 10); // ======== spParticRotulo ======== cons.weightx = 0.20; pnSetaDescricao.setPreferredSize(new Dimension(400, 60)); // ======== pnListaErros ======== { pnListaErros.setBorder(criaBorda(TradFerramentaDocType.ESCOLHA_DTD_CORRETO)); pnListaErros.setLayout(new BorderLayout()); // ======== scrollPanetabLinCod ======== { scrollPanetabLinCod.setViewportView(tabelaDoctypes); } pnListaErros.add(scrollPanetabLinCod, BorderLayout.CENTER); } // ======== pnBotoes ======== { // pnBotoes.setBorder(criaBorda("")); pnBotoes.setLayout(null); // ---- adicionar ---- // ---- aplicarRotulo ---- buscar.setText(TradSimuladorNavegacao.BUSCAR_PROXIMA); buscar.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { aplicarActionPerformed(e); } }); buscar.setToolTipText(TradSimuladorNavegacao.BUSCAR_TEXTO); buscar.getAccessibleContext().setAccessibleDescription(TradSimuladorNavegacao.BUSCAR_TEXTO); buscar.getAccessibleContext().setAccessibleName(TradSimuladorNavegacao.BUSCAR_TEXTO); buscar.setBounds(10, 5, 150, 25); // pnBotoes.add(buscar); } /* * Colocar os controles */ pnRegra.setBackground(CoresDefault.getCorPaineis()); regraFonteBtn.add(pnRegra, BorderLayout.NORTH); textAreaSourceCode.setBorder(criaBorda(TradFerramentaDocType.CODIGO_FONTE)); textAreaSourceCode.setBackground(CoresDefault.getCorPaineis()); regraFonteBtn.add(textAreaSourceCode, BorderLayout.CENTER); pnBotoes.setPreferredSize(new Dimension(600, 35)); pnBotoes.setBackground(CoresDefault.getCorPaineis()); regraFonteBtn.setBackground(CoresDefault.getCorPaineis()); contentPane.add(regraFonteBtn); JPanel textoErrosBtn = new JPanel(); textoErrosBtn.setLayout(new BorderLayout()); pnSetaDescricao.setBackground(CoresDefault.getCorPaineis()); pnSetaDescricao.add(pnBotoes, cons); textoErrosBtn.add(pnSetaDescricao, BorderLayout.NORTH); textoErrosBtn.add(pnListaErros, BorderLayout.CENTER); pnSalvarCancelar.setLayout(null); pnSalvarCancelar.setPreferredSize(new Dimension(600, 35)); pnSalvarCancelar.add(abrir); pnSalvarCancelar.add(salvar); pnSalvarCancelar.add(cancelar); if (!original) { reverter = new JButton("Reverter"); reverter.setText(TradPainelRelatorio.REVERTER); reverter.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(false); TxtBuffer.setContent(TxtBuffer.getContentOriginal()); parentFrame.showPainelFerramentaDoctypePArq(TxtBuffer.getContentOriginal()); setVisible(true); } }); reverter.setToolTipText(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleDescription(TradPainelRelatorio.DICA_REVERTER); reverter.getAccessibleContext().setAccessibleName(TradPainelRelatorio.DICA_REVERTER); reverter.setBounds(485, 0, 150, 25); pnSalvarCancelar.add(reverter); } pnSalvarCancelar.setBackground(CoresDefault.getCorPaineis()); textoErrosBtn.add(pnSalvarCancelar, BorderLayout.SOUTH); pnListaErros.setBackground(CoresDefault.getCorPaineis()); contentPane.setBackground(CoresDefault.getCorPaineis()); contentPane.add(textoErrosBtn); controla(conteudo); this.setVisible(true); }
From source file:ru.goodfil.catalog.ui.forms.MainWindow.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - ???????? ???? applicationMenuBar = new JMenuBar(); applicationMenu = new JMenu(); openMenuItem = new JMenuItem(); saveAsMenuItem = new JMenuItem(); QuitMenuItem = new JMenuItem(); menu2 = new JMenu(); menuItem2 = new JMenuItem(); miImportOe = new JMenuItem(); miDeployDatabase = new JMenuItem(); miFilterFormsAndTypes = new JMenuItem(); menu1 = new JMenu(); miExportOeToExcel = new JMenuItem(); menuItem1 = new JMenuItem(); helpMenu = new JMenu(); aboutMenuItem = new JMenuItem(); tabsPanel = new JTabbedPane(); carsTab = new JPanel(); filtersTab = new JPanel(); oeTab = new JPanel(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle("Goodwill - \u043a\u0430\u0442\u0430\u043b\u043e\u0433"); setIconImage(new ImageIcon(getClass().getResource("/ru/goodfil/catalog/ui/icons/car_compact_orange.png")) .getImage());/*w w w . j ava 2s . co m*/ Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout("default:grow", "fill:default:grow")); //======== applicationMenuBar ======== { //======== applicationMenu ======== { applicationMenu.setText("\u0424\u0430\u0439\u043b"); //---- openMenuItem ---- openMenuItem.setText("\u041e\u0442\u043a\u0440\u044b\u0442\u044c..."); openMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_ap\\16x16\\plain\\folder_blue.png")); openMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openMenuItemActionPerformed(e); } }); applicationMenu.add(openMenuItem); applicationMenu.addSeparator(); //---- saveAsMenuItem ---- saveAsMenuItem .setText("\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u0430\u043a..."); saveAsMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_ap\\16x16\\plain\\disk_blue.png")); saveAsMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveAsMenuItemActionPerformed(e); } }); applicationMenu.add(saveAsMenuItem); applicationMenu.addSeparator(); //---- QuitMenuItem ---- QuitMenuItem.setText("\u0412\u044b\u0445\u043e\u0434"); QuitMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_ap\\16x16\\plain\\exit.png")); QuitMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { QuitMenuItemActionPerformed(e); } }); applicationMenu.add(QuitMenuItem); } applicationMenuBar.add(applicationMenu); //======== menu2 ======== { menu2.setText("\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b"); //---- menuItem2 ---- menuItem2.setText("\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438..."); menu2.add(menuItem2); //---- miImportOe ---- miImportOe.setText("\u0418\u043c\u043f\u043e\u0440\u0442 \u041e\u0415..."); miImportOe.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miImportOeActionPerformed(); } }); menu2.add(miImportOe); //---- miDeployDatabase ---- miDeployDatabase.setText( "\u0412\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0411\u0414 \u043d\u0430 \u0441\u0430\u0439\u0442..."); miDeployDatabase.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miDeployDatabaseActionPerformed(); } }); menu2.add(miDeployDatabase); //---- miFilterFormsAndTypes ---- miFilterFormsAndTypes.setText( "\u0422\u0438\u043f\u044b \u0438 \u0444\u043e\u0440\u043c\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432..."); miFilterFormsAndTypes.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miFilterFormsAndTypesActionPerformed(e); } }); menu2.add(miFilterFormsAndTypes); //======== menu1 ======== { menu1.setText("\u0412\u044b\u0433\u0440\u0443\u0437\u043a\u0430 OE \u0432 Exel"); //---- miExportOeToExcel ---- miExportOeToExcel .setText("\u041a\u0430\u0442\u0430\u043b\u043e\u0433 (\u041a\u043d\u0438\u0433\u0430)"); miExportOeToExcel.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { miExportOeToExcelActionPerformed(e); } }); menu1.add(miExportOeToExcel); //---- menuItem1 ---- menuItem1.setText( "\u041a\u0440\u043e\u0441\u0441\u044b (\u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d)"); menuItem1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem1ExportOeCross(e); } }); menu1.add(menuItem1); } menu2.add(menu1); } applicationMenuBar.add(menu2); //======== helpMenu ======== { helpMenu.setText("\u0421\u043f\u0440\u0430\u0432\u043a\u0430"); //---- aboutMenuItem ---- aboutMenuItem.setText("\u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435..."); aboutMenuItem.setIcon(new ImageIcon( "E:\\Downloads\\IconExperience - X-Collections\\iconex_op\\16x16\\plain\\banana.png")); aboutMenuItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { aboutMenuItemActionPerformed(e); } }); helpMenu.add(aboutMenuItem); } applicationMenuBar.add(helpMenu); } setJMenuBar(applicationMenuBar); //======== tabsPanel ======== { //======== carsTab ======== { // JFormDesigner evaluation mark carsTab.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), carsTab.getBorder())); carsTab.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); carsTab.setLayout(null); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < carsTab.getComponentCount(); i++) { Rectangle bounds = carsTab.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = carsTab.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; carsTab.setMinimumSize(preferredSize); carsTab.setPreferredSize(preferredSize); } } tabsPanel.addTab("\u041c\u0430\u0448\u0438\u043d\u044b", carsTab); //======== filtersTab ======== { filtersTab.setLayout(null); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < filtersTab.getComponentCount(); i++) { Rectangle bounds = filtersTab.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = filtersTab.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; filtersTab.setMinimumSize(preferredSize); filtersTab.setPreferredSize(preferredSize); } } tabsPanel.addTab("\u0418\u0437\u0434\u0435\u043b\u0438\u044f", filtersTab); //======== oeTab ======== { oeTab.setLayout(null); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < oeTab.getComponentCount(); i++) { Rectangle bounds = oeTab.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = oeTab.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; oeTab.setMinimumSize(preferredSize); oeTab.setPreferredSize(preferredSize); } } tabsPanel.addTab("\u041e\u0415", oeTab); } contentPane.add(tabsPanel, cc.xy(1, 1)); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents carsTab.setLayout(new BorderLayout()); carsPanel = new CarsPanel(); carsTab.add(carsPanel, BorderLayout.CENTER); filtersTab.setLayout(new BorderLayout()); filtersPanel = new FiltersPanel(); filtersTab.add(filtersPanel, BorderLayout.CENTER); oeTab.setLayout(new BorderLayout()); oePanel = new OePanel(); oeTab.add(oePanel, BorderLayout.CENTER); }
From source file:net.openbyte.gui.WorkFrame.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Gary Lee menuBar1 = new JMenuBar(); menu2 = new JMenu(); menuItem8 = new JMenuItem(); menuItem6 = new JMenuItem(); menuItem4 = new JMenuItem(); menuItem5 = new JMenuItem(); menu3 = new JMenu(); menuItem7 = new JMenuItem(); menu6 = new JMenu(); menuItem11 = new JMenuItem(); menu1 = new JMenu(); menuItem1 = new JMenuItem(); menuItem2 = new JMenuItem(); menuItem3 = new JMenuItem(); menu4 = new JMenu(); menuItem9 = new JMenuItem(); menu5 = new JMenu(); menuItem10 = new JMenuItem(); scrollPane3 = new JScrollPane(); tree1 = new JTree(); rTextScrollPane1 = new RTextScrollPane(); rSyntaxTextArea1 = new RSyntaxTextArea(); //======== this ======== setTitle("Project Workspace"); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); Container contentPane = getContentPane(); contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS)); //======== menuBar1 ======== {/*ww w. j a va 2s . com*/ //======== menu2 ======== { menu2.setText("File"); //---- menuItem8 ---- menuItem8.setText("Add Class"); menuItem8.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem8ActionPerformed(e); } }); menu2.add(menuItem8); //---- menuItem6 ---- menuItem6.setText("Add Package"); menuItem6.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem6ActionPerformed(e); } }); menu2.add(menuItem6); //---- menuItem4 ---- menuItem4.setText("Save"); menuItem4.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem4ActionPerformed(e); } }); menu2.add(menuItem4); //---- menuItem5 ---- menuItem5.setText("Close Project"); menuItem5.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem5ActionPerformed(e); } }); menu2.add(menuItem5); } menuBar1.add(menu2); //======== menu3 ======== { menu3.setText("Edit"); //---- menuItem7 ---- menuItem7.setText("Delete"); menuItem7.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem7ActionPerformed(e); } }); menu3.add(menuItem7); } menuBar1.add(menu3); //======== menu6 ======== { menu6.setText("View"); //---- menuItem11 ---- menuItem11.setText("Output"); menuItem11.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem11ActionPerformed(e); } }); menu6.add(menuItem11); } menuBar1.add(menu6); //======== menu1 ======== { menu1.setText("Gradle"); //---- menuItem1 ---- menuItem1.setText("Run Client"); menuItem1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem1ActionPerformed(e); } }); menu1.add(menuItem1); //---- menuItem2 ---- menuItem2.setText("Run Server"); menuItem2.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem2ActionPerformed(e); } }); menu1.add(menuItem2); //---- menuItem3 ---- menuItem3.setText("Build Mod JAR"); menuItem3.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem3ActionPerformed(e); } }); menu1.add(menuItem3); } menuBar1.add(menu1); //======== menu4 ======== { menu4.setText("Git"); //---- menuItem9 ---- menuItem9.setText("Import into Git"); menuItem9.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem9ActionPerformed(e); menuItem9ActionPerformed(e); } }); menu4.add(menuItem9); //======== menu5 ======== { menu5.setText("Options"); menu5.setEnabled(false); //---- menuItem10 ---- menuItem10.setText("Commit"); menuItem10.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem10ActionPerformed(e); } }); menu5.add(menuItem10); } menu4.add(menu5); } menuBar1.add(menu4); } setJMenuBar(menuBar1); //======== scrollPane3 ======== { scrollPane3.setBorder(null); //---- tree1 ---- tree1.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "File Manager")); tree1.setBackground(new Color(240, 240, 240)); tree1.setPreferredSize(new Dimension(-600, 85)); tree1.addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent e) { tree1ValueChanged(e); } }); scrollPane3.setViewportView(tree1); } contentPane.add(scrollPane3); //======== rTextScrollPane1 ======== { rTextScrollPane1.setBorder(new TitledBorder(LineBorder.createGrayLineBorder(), "Code Editor")); //---- rSyntaxTextArea1 ---- rSyntaxTextArea1.setSyntaxEditingStyle("text/java"); rSyntaxTextArea1.setBackground(Color.white); rTextScrollPane1.setViewportView(rSyntaxTextArea1); } contentPane.add(rTextScrollPane1); setSize(1230, 785); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:fll.subjective.SubjectiveFrame.java
/** * Make sure the data in the table is valid. This checks to make sure that for * all rows, all columns that contain numeric data are actually set, or none * of these columns are set in a row. This avoids the case of partial data. * This method is fail fast in that it will display a dialog box on the first * error it finds./* w w w . j a va2 s.c o m*/ * * @return true if everything is ok */ @SuppressFBWarnings(value = "SIC_INNER_SHOULD_BE_STATIC_ANON", justification = "Static inner class to replace anonomous listener isn't worth the confusion of finding the class definition") private boolean validateData() { stopCellEditors(); final List<String> warnings = new LinkedList<String>(); for (final ScoreCategory subjectiveCategory : getChallengeDescription().getSubjectiveCategories()) { final String category = subjectiveCategory.getName(); final String categoryTitle = subjectiveCategory.getTitle(); final List<AbstractGoal> goals = subjectiveCategory.getGoals(); final List<Element> scoreElements = SubjectiveTableModel.getScoreElements(_scoreDocument, category); for (final Element scoreElement : scoreElements) { int numValues = 0; for (final AbstractGoal goal : goals) { final String goalName = goal.getName(); final Element subEle = SubjectiveUtils.getSubscoreElement(scoreElement, goalName); if (null != subEle) { final String value = subEle.getAttribute("value"); if (!value.isEmpty()) { numValues++; } } } if (numValues != goals.size() && numValues != 0) { warnings.add(categoryTitle + ": " + scoreElement.getAttribute("teamNumber") + " has too few scores (needs all or none): " + numValues); } } } if (!warnings.isEmpty()) { // join the warnings with carriage returns and display them final StyledDocument doc = new DefaultStyledDocument(); for (final String warning : warnings) { try { doc.insertString(doc.getLength(), warning + "\n", null); } catch (final BadLocationException ble) { throw new RuntimeException(ble); } } final JDialog dialog = new JDialog(this, "Warnings"); final Container cpane = dialog.getContentPane(); cpane.setLayout(new BorderLayout()); final JButton okButton = new JButton("Ok"); cpane.add(okButton, BorderLayout.SOUTH); okButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent ae) { dialog.setVisible(false); dialog.dispose(); } }); cpane.add(new JTextPane(doc), BorderLayout.CENTER); dialog.pack(); dialog.setVisible(true); return false; } else { return true; } }
From source file:com.kbotpro.ui.FieldWatcher.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents label2 = new JLabel(); updateRateSpinner = new JSpinner(); label3 = new JLabel(); scrollPane1 = new JScrollPane(); infoLabel = new JLabel(); //======== this ======== setTitle("Field Watch"); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); Container contentPane = getContentPane(); //---- label2 ---- label2.setText("Update rate:"); label2.setLabelFor(updateRateSpinner); //---- updateRateSpinner ---- updateRateSpinner.setModel(new SpinnerNumberModel(1.0, 0.1, null, 0.5)); //---- label3 ---- label3.setText("Times per second"); //======== scrollPane1 ======== {/*from ww w. j a va 2 s .c o m*/ //---- infoLabel ---- infoLabel.setText("Field info"); infoLabel.setVerticalAlignment(SwingConstants.TOP); scrollPane1.setViewportView(infoLabel); } GroupLayout contentPaneLayout = new GroupLayout(contentPane); contentPane.setLayout(contentPaneLayout); contentPaneLayout.setHorizontalGroup(contentPaneLayout.createParallelGroup() .add(contentPaneLayout.createSequentialGroup().addContainerGap().add(contentPaneLayout .createParallelGroup().add(scrollPane1, GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE) .add(contentPaneLayout.createSequentialGroup().add(label2) .addPreferredGap(LayoutStyle.RELATED) .add(updateRateSpinner, GroupLayout.PREFERRED_SIZE, 83, GroupLayout.PREFERRED_SIZE) .addPreferredGap(LayoutStyle.RELATED).add(label3))) .addContainerGap())); contentPaneLayout .setVerticalGroup(contentPaneLayout.createParallelGroup().add(GroupLayout.TRAILING, contentPaneLayout.createSequentialGroup().addContainerGap() .add(scrollPane1, GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE) .addPreferredGap(LayoutStyle.RELATED) .add(contentPaneLayout.createParallelGroup(GroupLayout.BASELINE).add(label2) .add(updateRateSpinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .add(label3)) .addContainerGap())); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.openmicroscopy.shoola.util.ui.MessengerDialog.java
/** * Builds and lays out the GUI. /*from w w w.ja v a 2s.c o m*/ * * @param toSubmit The collection of files to send. */ private void buildGUI(List<ImportErrorObject> toSubmit) { JComponent component; Icon icon; IconManager icons = IconManager.getInstance(); String message; if (dialogType == SUBMIT_ERROR_TYPE) { message = SUBMIT_MESSAGE; component = buildExceptionPane(toSubmit); icon = icons.getIcon(IconManager.SUBMIT_ICON_64); if (icon == null) icon = UIManager.getIcon("OptionPane.errorIcon"); } else if (exception == null) { message = MESSAGE; icon = icons.getIcon(IconManager.COMMENT_ICON_64); if (icon == null) icon = UIManager.getIcon("OptionPane.questionIcon"); component = buildCommentPane(COMMENT_FIELD); } else { message = DEBUG_MESSAGE; component = buildExceptionPane(null); icon = icons.getIcon(IconManager.ERROR_ICON_64); if (icon == null) icon = UIManager.getIcon("OptionPane.errorIcon"); } Container c = getContentPane(); TitlePanel tp = new TitlePanel(getTitle(), message, icon); c.setLayout(new BorderLayout(0, 0)); c.add(tp, BorderLayout.NORTH); c.add(component, BorderLayout.CENTER); c.add(buildToolBar(toSubmit != null && toSubmit.size() > 0), BorderLayout.SOUTH); }