Java Code Examples for javax.swing.JTextArea

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project seamless, under directory /swing/src/main/java/org/seamless/swing/.

Source file: Application.java

  19 
vote

public static void showError(Component parent,Throwable ex){
  final JTextArea textArea=new JTextArea();
  textArea.setFont(new Font("Sans-Serif",Font.PLAIN,10));
  textArea.setEditable(false);
  StringWriter writer=new StringWriter();
  ex.printStackTrace(new PrintWriter(writer));
  textArea.setText(writer.toString());
  JScrollPane scrollPane=new JScrollPane(textArea);
  scrollPane.setPreferredSize(new Dimension(350,150));
  JOptionPane.showMessageDialog(parent,scrollPane,"An Error Has Occurred",JOptionPane.ERROR_MESSAGE);
}
 

Example 2

From project codjo-control, under directory /codjo-control-gui/src/main/java/net/codjo/control/gui/plugin/.

Source file: DefaultQuarantineDetailWindow.java

  18 
vote

private void declareErrorFields(){
  JTextArea jta=new JTextArea();
  jta.setRows(5);
  jta.setEditable(false);
  addField(this.dataSource,ERROR_LOG,translate("DefaultQuarantineDetailWindow.errorLog",guiContext),jta,null);
  dataSource.declare(ERROR_TYPE,new JTextField());
}
 

Example 3

From project codjo-imports, under directory /codjo-imports-gui/src/main/java/net/codjo/imports/gui/.

Source file: FieldImportDetailWindow.java

  18 
vote

protected void addField(String fieldName,JLabel label,JComponent comp){
  if (comp instanceof JTextArea) {
    JTextArea textArea=(JTextArea)comp;
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    mainPanel.addItem(label,new JScrollPane(textArea,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER));
  }
 else {
    mainPanel.addItem(label,comp);
  }
  dataSource.declare(fieldName,comp);
}
 

Example 4

From project dawn-common, under directory /org.dawb.hdf5/src/ncsa/hdf/view/.

Source file: DefaultMetaDataView.java

  18 
vote

private JPanel createNamedDatatypeInfoPanel(Datatype t){
  JPanel panel=new JPanel();
  panel.setLayout(new BorderLayout());
  JTextArea infoArea=new JTextArea(t.getDatatypeDescription());
  infoArea.setEditable(false);
  panel.add(infoArea,BorderLayout.CENTER);
  return panel;
}
 

Example 5

From project des, under directory /daemon/lib/apache-log4j-1.2.16/src/main/java/org/apache/log4j/lf5/viewer/.

Source file: LogBrokerMonitor.java

  18 
vote

protected JTextArea createDetailTextArea(){
  JTextArea detailTA=new JTextArea();
  detailTA.setFont(new Font("Monospaced",Font.PLAIN,14));
  detailTA.setTabSize(3);
  detailTA.setLineWrap(true);
  detailTA.setWrapStyleWord(false);
  return (detailTA);
}
 

Example 6

From project drugis-common, under directory /common-gui/src/main/java/org/drugis/common/gui/.

Source file: TextComponentFactory.java

  18 
vote

public static JScrollPane createTextArea(ValueModel model,boolean editable,boolean commitOnFocusLost){
  JTextArea area=BasicComponentFactory.createTextArea(model,commitOnFocusLost);
  dontStealTabKey(area);
  area.setEditable(editable);
  area.setLineWrap(true);
  area.setWrapStyleWord(true);
  if (!editable) {
    area.setUI(new javax.swing.plaf.basic.BasicTextAreaUI());
  }
  JScrollPane pane=new JScrollPane(area);
  pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
  pane.setPreferredSize(new Dimension(DefaultUnitConverter.getInstance().dialogUnitXAsPixel(200,area),DefaultUnitConverter.getInstance().dialogUnitYAsPixel(50,area)));
  return pane;
}
 

Example 7

From project en4j, under directory /NBPlatformApp/NoteContentViewModule/src/main/java/com/rubenlaguna/en4j/NoteContentViewModule/.

Source file: ENMLReplacedElementFactory.java

  18 
vote

private ReplacedElement brokenImage(LayoutContext context,int cssWidth,int cssHeight){
  ReplacedElement toReturn=null;
  JTextArea cc=new JTextArea();
  cc.setText("Missing implementation for en-media");
  cc.setSize(cc.getPreferredSize());
  toReturn=new SwingReplacedElement(cc){
    public boolean isRequiresInteractivePaint(){
      return false;
    }
  }
;
  return toReturn;
}
 

Example 8

From project encog-java-workbench, under directory /src/main/java/org/encog/workbench/dialogs/common/.

Source file: InformationField.java

  18 
vote

public int createField(JPanel panel,int x,int y,int width){
  JTextArea l=new JTextArea(this.getLabel());
  l.setEditable(false);
  l.setLineWrap(true);
  l.setBackground(this.getOwner().getBackground());
  l.setWrapStyleWord(true);
  l.setSize(new Dimension(this.getOwner().getWidth(),this.height * (l.getFontMetrics(l.getFont())).getHeight()));
  this.setLabelControl(null);
  l.setLocation(new Point(0,y));
  panel.add(l);
  return y + 100;
}
 

Example 9

From project formic, under directory /src/java/org/formic/wizard/step/gui/.

Source file: TemplateStep.java

  18 
vote

/** 
 * {@inheritDoc}
 * @see org.formic.wizard.WizardStep#displayed()
 */
public void displayed(){
  if (content instanceof JEditorPane) {
    JEditorPane editor=(JEditorPane)content;
    editor.setText(action.processTemplate(html));
    editor.setCaretPosition(0);
  }
 else {
    JTextArea area=(JTextArea)content;
    area.setText(action.processTemplate(text));
    area.setCaretPosition(0);
  }
}
 

Example 10

From project GenericKnimeNodes, under directory /com.genericworkflownodes.knime.base_plugin/src/com/genericworkflownodes/knime/generic_node/.

Source file: GenericKnimeNodeView.java

  18 
vote

private JScrollPane createScrollableOutputArea(final String content){
  JTextArea text=new JTextArea(content,40,80);
  text.setFont(new Font("Monospaced",Font.BOLD,12));
  text.setEditable(false);
  if (content.length() == 0) {
    text.setEnabled(false);
  }
  JScrollPane scrollpane=new JScrollPane(text);
  return scrollpane;
}
 

Example 11

From project Java3DTest, under directory /Java3D/src/.

Source file: GUI_3D.java

  18 
vote

public void actionPerformed(ActionEvent e){
  JFrame aboutFrame=new JFrame("About");
  aboutFrame.setVisible(true);
  aboutFrame.setSize(400,250);
  JTextArea aboutText=new JTextArea("This application was created by:" + "\n\nJennifer Hill\nRyan Kane\nDorothy Kirlew\n" + "Donald Shaner\nand Sean Weber"+ "\n \n \n"+ "The 3D Manipulator is released under the GNU GPLv3 license, "+ " freely distributable for educational use only.");
  Font JTextFont=new Font("Verdana",Font.BOLD,12);
  aboutText.setFont(JTextFont);
  aboutText.setPreferredSize(new Dimension(380,250));
  aboutText.setLineWrap(true);
  aboutText.setWrapStyleWord(true);
  JPanel panel=new JPanel();
  aboutFrame.add(panel);
  panel.add(aboutText);
}
 

Example 12

From project jCAE, under directory /jcae/core/src/org/jcae/netbeans/cad/.

Source file: BoundingBoxAction.java

  18 
vote

protected void performAction(Node[] arg0){
  double[] bbox=GeomUtils.getShape(arg0[0]).getBounds();
  String text="Xmin=" + bbox[0] + CR;
  text+="Ymin=" + bbox[1] + CR;
  text+="Zmin=" + bbox[2] + CR;
  text+="Xmax=" + bbox[3] + CR;
  text+="Ymax=" + bbox[4] + CR;
  text+="Zmax=" + bbox[5] + CR;
  JTextArea textField=new JTextArea(text);
  textField.setEditable(false);
  DialogDescriptor dd=new DialogDescriptor(textField,"Bounding box");
  DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
}
 

Example 13

From project jreversepro, under directory /src/main/java/org/jreversepro/gui/.

Source file: DlgAbout.java

  18 
vote

/** 
 * @param aParent Parent Frame
 * @param aTitle Title of the Dialog box.
 */
public DlgAbout(JFrame aParent,String aTitle){
  super(aParent,aTitle,true);
  JTextArea txtAbout=new JTextArea(JReverseProContext.GPL_INFO);
  JScrollPane ScrAbout=new JScrollPane(txtAbout);
  txtAbout.setEditable(false);
  getContentPane().setLayout(new GridLayout(1,1));
  getContentPane().add(ScrAbout);
  setSize(400,170);
  setLocation(150,50);
  setResizable(false);
  setVisible(true);
  addWindowListener(new DlgClose());
}
 

Example 14

From project log4jna, under directory /thirdparty/log4j/src/main/java/org/apache/log4j/lf5/viewer/.

Source file: LogBrokerMonitor.java

  18 
vote

protected JTextArea createDetailTextArea(){
  JTextArea detailTA=new JTextArea();
  detailTA.setFont(new Font("Monospaced",Font.PLAIN,14));
  detailTA.setTabSize(3);
  detailTA.setLineWrap(true);
  detailTA.setWrapStyleWord(false);
  return (detailTA);
}
 

Example 15

From project niravCS2103, under directory /CS2103/lib/apache-log4j-1.2.16/src/main/java/org/apache/log4j/lf5/viewer/.

Source file: LogBrokerMonitor.java

  18 
vote

protected JTextArea createDetailTextArea(){
  JTextArea detailTA=new JTextArea();
  detailTA.setFont(new Font("Monospaced",Font.PLAIN,14));
  detailTA.setTabSize(3);
  detailTA.setLineWrap(true);
  detailTA.setWrapStyleWord(false);
  return (detailTA);
}
 

Example 16

From project oops, under directory /application/src/main/java/nl/rug/ai/mas/oops/.

Source file: ScriptEditor.java

  18 
vote

private static JTextArea createEditor(){
  JTextArea editorArea=new JTextArea();
  editorArea.setFont(new Font("Monospaced",Font.PLAIN,11));
  editorArea.setLineWrap(true);
  editorArea.setWrapStyleWord(true);
  return editorArea;
}
 

Example 17

From project RomRaider, under directory /src/com/romraider/maps/.

Source file: TableSwitch.java

  18 
vote

public void setDescription(String description){
  super.setDescription(description);
  JTextArea descriptionArea=new JTextArea(description);
  descriptionArea.setOpaque(false);
  descriptionArea.setEditable(false);
  descriptionArea.setWrapStyleWord(true);
  descriptionArea.setLineWrap(true);
  descriptionArea.setMargin(new Insets(0,5,5,5));
  add(descriptionArea,BorderLayout.SOUTH);
}
 

Example 18

From project TraVis, under directory /src/travis/controller/.

Source file: UIHelper.java

  18 
vote

public void displayException(Exception e){
  killAllAttachers();
  e.printStackTrace();
  StringBuilder sb=new StringBuilder(e.toString());
  for (  StackTraceElement trace : e.getStackTrace()) {
    sb.append("\n   at ");
    sb.append(trace);
  }
  JTextArea textArea=new JTextArea(sb.toString());
  textArea.setEditable(false);
  JScrollPane scrollPane=new JScrollPane(textArea);
  scrollPane.setPreferredSize(new Dimension(500,250));
  JOptionPane.showMessageDialog(frame,scrollPane,Messages.get("exception"),JOptionPane.ERROR_MESSAGE);
}
 

Example 19

From project twinkle, under directory /src/main/java/ch/swingfx/twinkle/window/.

Source file: DefaultNotificationWindow.java

  18 
vote

/** 
 * Constructs a new display only  {@link JTextArea}
 * @param text text that the {@link JTextArea} displays
 * @return a new display only {@link JTextArea}
 */
private JTextArea getTextAreaForDisplay(String text){
  final JTextArea ta=new JTextArea(text);
  ta.setUI(new BasicTextAreaUI());
  ta.setEditable(false);
  ta.setFocusable(false);
  ta.setOpaque(false);
  ta.setWrapStyleWord(true);
  ta.setLineWrap(true);
  return ta;
}
 

Example 20

From project watchmaker, under directory /swing/src/java/main/org/uncommons/watchmaker/swing/.

Source file: ObjectSwingRenderer.java

  18 
vote

/** 
 * Calls  {@link Object#toString()} on the specified entity and createsa  {@link JTextArea} containing that text.
 * @param entity The evolved entity to render.
 * @return A text area containing the string representation of the entity.
 */
public JComponent render(Object entity){
  JTextArea text=new JTextArea(entity.toString());
  text.setEditable(false);
  text.setBackground(null);
  text.setLineWrap(true);
  text.setWrapStyleWord(true);
  return text;
}
 

Example 21

From project addis, under directory /application/src/main/java/org/drugis/addis/gui/.

Source file: AddisWindow.java

  17 
vote

public boolean deleteEntity(final Entity selected,final boolean confirmation){
  String selectedType=getEntityKnowledge(selected).getSingularCapitalized();
  if (confirmation) {
    int conf=JOptionPane.showConfirmDialog(this,"Do you really want to delete " + selectedType + " "+ selected+ " ?","Confirm deletion",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,MainWindow.IMAGELOADER.getIcon(org.drugis.mtc.gui.FileNames.ICON_DELETE));
    if (conf != JOptionPane.YES_OPTION) {
      return false;
    }
  }
  try {
    getDomain().deleteEntity(selected);
  }
 catch (  DependentEntitiesException e) {
    String str=new String(selected + " is used by: ");
    for (    Entity en : e.getDependents()) {
      str+="\n\t" + en;
    }
    str+="\n - delete these first.";
    JTextArea text=new JTextArea(str);
    text.setWrapStyleWord(true);
    text.setLineWrap(true);
    text.setMargin(new Insets(5,5,5,5));
    JScrollPane sp=new JScrollPane(text);
    sp.setPreferredSize(new Dimension(300,200));
    JOptionPane.showMessageDialog(this,sp,"Error deleting " + selected,JOptionPane.ERROR_MESSAGE);
  }
  return true;
}
 

Example 22

From project CBCJVM, under directory /cbc/CBCJVM/src/cbccore/low/simulator/.

Source file: SimulatedDisplay.java

  17 
vote

public SimulatedDisplay(CBCSimulator c){
  cbc=c;
  textBox=new JTextArea("On Simulator!\n");
  textBox.setLineWrap(true);
  out=new PrintStream(new TextAreaOutputStream(textBox,TextAreaOutputStream.DEFAULT_BUFFER_SIZE));
}
 

Example 23

From project ceres, under directory /ceres-ui/src/test/java/com/bc/ceres/swing/binding/.

Source file: BindingContextTest.java

  17 
vote

public void testBindTextArea() throws ValidationException, BadLocationException {
  JTextArea textArea=new JTextArea();
  TextComponentAdapter textComponentAdapter=new TextComponentAdapter(textArea);
  Binding binding=bindingContextVB.bind("stringValue",textComponentAdapter);
  assertNotNull(binding);
  assertSame(textArea,getPrimaryComponent(binding));
  assertNotNull(binding.getComponents());
  assertEquals(1,binding.getComponents().length);
  assertEquals("stringValue",textArea.getName());
  textArea.setText("Bibo");
  textComponentAdapter.actionPerformed(null);
  assertEquals("Bibo",propertyContainerVB.getValue("stringValue"));
  propertyContainerVB.setValue("stringValue","Samson");
  assertEquals("Samson",textArea.getText());
}
 

Example 24

From project Chess_1, under directory /src/chess/gui/.

Source file: MenuMaker.java

  17 
vote

public void actionPerformed(ActionEvent event){
  Class[] types=m.getParameterTypes();
  Object[] values=new Object[types.length];
  for (int i=0; i < types.length; i++) {
    values[i]=makeDefaultValue(types[i]);
  }
  if (types.length > 0) {
    PropertySheet sheet=new PropertySheet(types,values);
    JOptionPane.showMessageDialog(this,sheet,resources.getString("dialog.method.params"),JOptionPane.QUESTION_MESSAGE);
    values=sheet.getValues();
  }
  try {
    Object result=m.invoke(occupant,values);
    parent.repaint();
    if (m.getReturnType() != void.class) {
      String resultString=result.toString();
      Object resultObject;
      final int MAX_LENGTH=50;
      final int MAX_HEIGHT=10;
      if (resultString.length() < MAX_LENGTH)       resultObject=resultString;
 else {
        int rows=Math.min(MAX_HEIGHT,1 + resultString.length() / MAX_LENGTH);
        JTextArea pane=new JTextArea(rows,MAX_LENGTH);
        pane.setText(resultString);
        pane.setLineWrap(true);
        resultObject=new JScrollPane(pane);
      }
      JOptionPane.showMessageDialog(parent,resultObject,resources.getString("dialog.method.return"),JOptionPane.INFORMATION_MESSAGE);
    }
  }
 catch (  InvocationTargetException ex) {
    parent.new GUIExceptionHandler().handle(ex.getCause());
  }
catch (  Exception ex) {
    parent.new GUIExceptionHandler().handle(ex);
  }
}
 

Example 25

From project codjo-data-process, under directory /codjo-data-process-gui/src/main/java/net/codjo/dataprocess/gui/launcher/result/table/.

Source file: ResultPanel.java

  17 
vote

private void showTreatmentDetails(){
  if (table.getSelectedRowCount() != 0) {
    TreatmentResult treatmentResult=(TreatmentResult)getAllSelectedDataRows(table)[0];
    String state;
switch (treatmentResult.getState()) {
case TreatmentResult.OK:
      state="OK";
    break;
case TreatmentResult.NOT_STARTED:
  state="Pas d?arrĀ";
break;
case TreatmentResult.STARTED:
state="En cours...";
break;
default :
state="ERREUR";
}
String result=treatmentResult.getTitle() + " : " + state+ "\n\n"+ treatmentResult.getMessage();
JFrame parentFrame=(JFrame)SwingUtilities.getWindowAncestor(this);
StandardDialog standardDialog=new StandardDialog(parentFrame,"D?ails du r?ultat du traitement");
standardDialog.getCancelButton().setVisible(false);
JScrollPane jScrollPane=new JScrollPane();
JTextArea textArea=new JTextArea(result);
textArea.setEditable(false);
textArea.setLineWrap(true);
jScrollPane.getViewport().add(textArea,null);
standardDialog.setContentPane(jScrollPane);
GuiUtils.setMaxSize(standardDialog,400,300);
standardDialog.pack();
centerWindow(standardDialog);
standardDialog.setVisible(true);
}
}
 

Example 26

From project drools-planner, under directory /drools-planner-examples/src/main/java/org/drools/planner/examples/app/.

Source file: DroolsPlannerExamplesApp.java

  17 
vote

private JPanel createDescriptionPanel(){
  JPanel descriptionPanel=new JPanel(new BorderLayout());
  descriptionPanel.add(new JLabel("Description"),BorderLayout.NORTH);
  descriptionTextArea=new JTextArea(8,80);
  descriptionTextArea.setEditable(false);
  descriptionPanel.add(new JScrollPane(descriptionTextArea,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER),BorderLayout.CENTER);
  return descriptionPanel;
}
 

Example 27

From project droolsjbpm-integration, under directory /droolsjbpm-integration-examples/src/main/java/org/drools/examples/broker/ui/.

Source file: LogPanel.java

  17 
vote

public LogPanel(){
  setLayout(new BorderLayout());
  log=new JTextArea();
  log.setEditable(false);
  JScrollPane areaScrollPane=new JScrollPane(log);
  areaScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  add(areaScrollPane,BorderLayout.CENTER);
  setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
  setPreferredSize(new Dimension(400,50));
}
 

Example 28

From project freemind, under directory /freemind/plugins/latex/.

Source file: JZoomedHotEqn.java

  17 
vote

private void edit(){
  JTextArea textArea=new JTextArea(getEquation());
  textArea.setLineWrap(true);
  textArea.setWrapStyleWord(true);
  final JScrollPane editorScrollPane=new JScrollPane(textArea);
  editorScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
  editorScrollPane.setPreferredSize(new Dimension(500,160));
  JDialog edit=new JDialog(JOptionPane.getFrameForComponent(this),editorTitle,true);
  edit.getContentPane().add(editorScrollPane);
  edit.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  edit.pack();
  edit.setLocationRelativeTo(this);
  edit.setVisible(true);
  String eq=textArea.getText();
  model.setContent(null,eq);
}
 

Example 29

From project gitblit, under directory /src/com/gitblit/client/.

Source file: Utils.java

  17 
vote

public static void showException(Component c,Throwable t){
  StringWriter writer=new StringWriter();
  t.printStackTrace(new PrintWriter(writer));
  String stacktrace=writer.toString();
  try {
    writer.close();
  }
 catch (  Throwable x) {
  }
  JTextArea textArea=new JTextArea(stacktrace);
  textArea.setFont(new Font("monospaced",Font.PLAIN,11));
  JScrollPane jsp=new JScrollPane(textArea);
  jsp.setPreferredSize(new Dimension(800,400));
  JOptionPane.showMessageDialog(c,jsp,Translation.get("gb.error"),JOptionPane.ERROR_MESSAGE);
}
 

Example 30

From project glg2d, under directory /src/test/java/glg2d/.

Source file: UIDemo.java

  17 
vote

JComponent createInputComponent(){
  JPanel panel=new JPanel();
  JComboBox box=new JComboBox(new String[]{"alpha","bravo","charlie","delta","echo","foxtrot","golf","hotel"});
  panel.add(box);
  JSpinner spinner=new JSpinner(new SpinnerNumberModel());
  panel.add(spinner);
  spinner=new JSpinner(new SpinnerDateModel());
  panel.add(spinner);
  JTextField field=new JTextField();
  field.setText("lorem ipsum...");
  field.setColumns(10);
  panel.add(field);
  JTextArea area=new JTextArea();
  area.setText("lorem ipsum... lorem ipsum lorem ipsum...\n lorem ipsum...\n lorem ipsum...");
  area.setColumns(10);
  area.setRows(3);
  panel.add(new JScrollPane(area));
  JPanel p=new JPanel();
  p.setPreferredSize(new Dimension(100,50));
  panel.add(new JScrollPane(p,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS));
  JSlider slider=new JSlider();
  slider.setPaintTicks(true);
  slider.setPaintLabels(true);
  panel.add(slider);
  return panel;
}
 

Example 31

From project Gmote, under directory /gmoteserver/src/org/gmote/server/.

Source file: MediaPathChooserUi.java

  17 
vote

/** 
 * This method initializes txtDescription	
 * @return javax.swing.JTextArea	
 */
private JTextArea getTxtDescription(){
  if (txtDescription == null) {
    txtDescription=new JTextArea();
    txtDescription.setLineWrap(true);
    txtDescription.setWrapStyleWord(true);
    txtDescription.setEnabled(true);
    txtDescription.setEditable(false);
    txtDescription.setBackground(Color.DARK_GRAY);
    txtDescription.setForeground(Color.white);
    txtDescription.setText("Please identify the location of your movies and music. This will allow you to easily find the media you wish to run when using the remote.");
  }
  return txtDescription;
}
 

Example 32

From project GraphWalker, under directory /src/main/java/org/graphwalker/GUI/.

Source file: App.java

  17 
vote

private void createPanelStatistics(){
  panelStatistics=new JPanel();
  panelStatistics.setLayout(new BorderLayout());
  statisticsTextArea=new JTextArea();
  statisticsTextArea.setPreferredSize(new Dimension(300,100));
  panelStatistics.add(statisticsTextArea,BorderLayout.CENTER);
}
 

Example 33

From project groovejaar, under directory /src/groovejaar/.

Source file: LyricsGui.java

  17 
vote

/** 
 * Create the frame.
 */
public LyricsGui(String text){
  setTitle("Lyrics");
  this.setIconImage(new ImageUtil().getLogo());
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  setBounds(100,100,560,343);
  contentPane=new JPanel();
  contentPane.setBorder(new EmptyBorder(5,5,5,5));
  setContentPane(contentPane);
  JTextArea txtrTexthtml=new JTextArea();
  txtrTexthtml.setEditable(false);
  txtrTexthtml.setLineWrap(true);
  txtrTexthtml.setRows(8);
  JScrollPane scrollingResult=new JScrollPane(txtrTexthtml);
  JLabel lblLyric=new JLabel("Lyric (maybe this can be a wrong lyric, take care!):");
  lblLyric.setFont(new Font("Tahoma",Font.BOLD,11));
  txtrTexthtml.setText(" " + text.replaceAll("<br />,","\n"));
  GroupLayout gl_contentPane=new GroupLayout(contentPane);
  gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING).addGroup(gl_contentPane.createSequentialGroup().addGap(10).addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING).addComponent(scrollingResult,Alignment.LEADING).addComponent(lblLyric,Alignment.LEADING,GroupLayout.DEFAULT_SIZE,404,Short.MAX_VALUE)).addGap(10)));
  gl_contentPane.setVerticalGroup(gl_contentPane.createParallelGroup(Alignment.LEADING).addGroup(gl_contentPane.createSequentialGroup().addGap(11).addComponent(lblLyric).addPreferredGap(ComponentPlacement.RELATED).addComponent(scrollingResult,GroupLayout.DEFAULT_SIZE,224,Short.MAX_VALUE)));
  contentPane.setLayout(gl_contentPane);
}
 

Example 34

From project Holo-Edit, under directory /holoedit/util/.

Source file: Ut.java

  17 
vote

/** 
 * Permet l'affichage d'un message d'exception dans un dialog. avec un bouton details... 
 */
public static void showError(Exception e){
  String shortMessage="Exception while loading/running the script." + "'\nMessage is:\n\n" + e.getMessage();
  String totalMessage=prepareStackTrace(e);
  JTextArea textArea=new JTextArea(totalMessage.toString());
  textArea.setEditable(false);
  textArea.setBorder(BorderFactory.createTitledBorder("Details"));
  final JScrollPane scrollPane=new JScrollPane(textArea);
  scrollPane.setVisible(false);
  JButton details=new JButton("Details...");
  details.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      scrollPane.setVisible(!scrollPane.isVisible());
      JDialog dialog=(JDialog)((JComponent)e.getSource()).getRootPane().getParent();
      dialog.pack();
    }
  }
);
  JButton okButton=new JButton("OK");
  okButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      JDialog dialog=(JDialog)((JComponent)e.getSource()).getRootPane().getParent();
      dialog.dispose();
    }
  }
);
  JPanel buttonsPanel=new JPanel(new FlowLayout());
  buttonsPanel.add(okButton);
  buttonsPanel.add(details);
  JPanel mainPanel=new JPanel(new BorderLayout());
  mainPanel.add(scrollPane,BorderLayout.CENTER);
  mainPanel.add(buttonsPanel,BorderLayout.SOUTH);
  JOptionPane.showOptionDialog(null,shortMessage,"Error",JOptionPane.OK_OPTION,JOptionPane.ERROR_MESSAGE,null,new Object[]{mainPanel},okButton);
}
 

Example 35

From project hudsontrayapp-plugin, under directory /client-common/src/main/java/org/hudson/trayapp/gui/.

Source file: MainFrame.java

  17 
vote

/** 
 * This method initializes licenseInformationTextArea	
 * @return javax.swing.JTextArea	
 */
private JTextArea getLicenseInformationTextArea(){
  if (licenseInformationTextArea == null) {
    licenseInformationTextArea=new JTextArea();
    licenseInformationTextArea.setEditable(false);
    licenseInformationTextArea.setText("Hudson Tray Application\n\nAuthors:\nDavid Hayes\n\nLicense:\nGPLv3 (http://www.gnu.org/licenses/gpl.html) - Compatible with Hudson's MIT License\n\nContributory Code:\nBase64 - iHarder.net (Public Domain)\nTableSorter - Sun JDK 1.4.2_17 Demo (Public Domain)\njdic - jdic.dev.java.net (LGPL)");
  }
  return licenseInformationTextArea;
}
 

Example 36

From project imageflow, under directory /src/de/danielsenff/imageflow/.

Source file: ImageFlowView.java

  17 
vote

public CodePreviewDialog(final JFrame frame,final String title){
  setPreferredSize(new Dimension(350,150));
  ta=new JTextArea();
  setLayout(new BorderLayout());
  setTitle(title);
  final JScrollPane scrollPane=new JScrollPane(ta);
  add(scrollPane,BorderLayout.CENTER);
  pack();
  setVisible(true);
}
 

Example 37

From project jASM_16, under directory /src/main/java/de/codesourcery/jasm16/ide/ui/utils/.

Source file: UIUtils.java

  17 
vote

public static JDialog createMessageDialog(Window parent,String title,String msg){
  final JDialog dialog=new JDialog(parent,title);
  final JTextArea message=createMultiLineLabel(msg);
  final JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new FlowLayout());
  final JPanel messagePanel=new JPanel();
  messagePanel.setLayout(new GridBagLayout());
  GridBagConstraints cnstrs=constraints(0,0,true,false,GridBagConstraints.NONE);
  cnstrs.gridwidth=GridBagConstraints.REMAINDER;
  cnstrs.weighty=0;
  cnstrs.gridheight=1;
  messagePanel.add(message,cnstrs);
  final JPanel panel=new JPanel();
  panel.setLayout(new GridBagLayout());
  cnstrs=constraints(0,0,true,false,GridBagConstraints.NONE);
  cnstrs.gridwidth=GridBagConstraints.REMAINDER;
  cnstrs.gridheight=1;
  cnstrs.weighty=0;
  cnstrs.insets=new Insets(5,2,5,2);
  panel.add(messagePanel,cnstrs);
  cnstrs=constraints(0,1,true,true,GridBagConstraints.HORIZONTAL);
  cnstrs.gridwidth=GridBagConstraints.REMAINDER;
  cnstrs.gridheight=1;
  cnstrs.weighty=0;
  cnstrs.insets=new Insets(0,2,10,2);
  panel.add(buttonPanel,cnstrs);
  dialog.getContentPane().add(panel);
  dialog.pack();
  return dialog;
}
 

Example 38

From project jchempaint, under directory /src/main/org/openscience/jchempaint/dialog/.

Source file: AboutDialog.java

  17 
vote

public void doInit(){
  String version=JCPPropertyHandler.getInstance(true).getVersion();
  String s1="JChemPaint " + version + "\n";
  s1+=GT._("An open-source editor for 2D chemical structures.");
  String s2=GT._("An OpenScience project.") + "\n";
  s2+=GT._("See 'http://jchempaint.github.com' for more information.");
  getContentPane().setLayout(new BorderLayout());
  getContentPane().setBackground(Color.white);
  JLabel label1=new JLabel();
  try {
    JCPPropertyHandler jcpph=JCPPropertyHandler.getInstance(true);
    URL url=jcpph.getResource("jcplogo" + JCPAction.imageSuffix);
    ImageIcon icon=new ImageIcon(url);
    label1=new JLabel(icon);
  }
 catch (  Exception exception) {
    logger.error("Cannot add JCP logo: " + exception.getMessage());
    logger.debug(exception);
  }
  label1.setBackground(Color.white);
  Border lb=BorderFactory.createLineBorder(Color.white,5);
  JTextArea jtf1=new JTextArea(s1);
  jtf1.setBorder(lb);
  jtf1.setEditable(false);
  JTextArea jtf2=new JTextArea(s2);
  jtf2.setEditable(false);
  jtf2.setBorder(lb);
  getContentPane().add("Center",label1);
  getContentPane().add("North",jtf1);
  getContentPane().add("South",jtf2);
  pack();
  setVisible(true);
}
 

Example 39

From project jmeter-amf, under directory /src/protocol/amf/org/apache/jmeter/protocol/amf/gui/.

Source file: AmfXmlEditorGui.java

  17 
vote

private JPanel createAmfXmlEditor(){
  JPanel panel=new JPanel();
  panel.setLayout(new BorderLayout());
  panel.setBorder(BorderFactory.createTitledBorder("AMF XML Editor"));
  textArea=new JTextArea(40,80);
  JScrollPane scrollableTextArea=new JScrollPane(textArea);
  panel.add(scrollableTextArea,BorderLayout.CENTER);
  panel.add(createButtons(),BorderLayout.PAGE_END);
  return panel;
}
 

Example 40

From project jsmaa, under directory /gui/src/main/java/fi/smaa/jsmaa/gui/.

Source file: GNUPlotDialog.java

  17 
vote

public GNUPlotDialog(JFrame parent,PlotConverter c){
  super(parent,"GNUPlot script");
  setPreferredSize(new Dimension(700,400));
  JPanel pane=new JPanel();
  pane.setLayout(new BoxLayout(pane,BoxLayout.PAGE_AXIS));
  JLabel label1=new JLabel("Script");
  label1.setAlignmentX(Component.CENTER_ALIGNMENT);
  pane.add(label1);
  JTextArea scriptArea=new JTextArea();
  scriptArea.setEditable(false);
  scriptArea.setText(c.getScript());
  pane.add(new JScrollPane(scriptArea));
  JLabel label2=new JLabel("Data file (save as data.dat)");
  label2.setAlignmentX(Component.CENTER_ALIGNMENT);
  pane.add(label2);
  JTextArea dataArea=new JTextArea();
  dataArea.setEditable(false);
  dataArea.setText(c.getData());
  pane.add(new JScrollPane(dataArea));
  JButton closeButton=new JideButton("Close");
  closeButton.addActionListener(new AbstractAction(){
    public void actionPerformed(    ActionEvent arg0){
      setVisible(false);
    }
  }
);
  closeButton.setAlignmentX(Component.CENTER_ALIGNMENT);
  pane.add(closeButton);
  setContentPane(pane);
  pack();
}
 

Example 41

From project kabeja, under directory /blocks/svg/src/main/java/org/kabeja/processing/scripting/impl/.

Source file: JavaScriptShell.java

  17 
vote

public JComponent getView(){
  textArea=new JTextArea();
  textArea.addKeyListener(new CommandKeyListener());
  this.initActions();
  JPanel panel=new JPanel(new BorderLayout());
  panel.add(new JScrollPane(textArea),BorderLayout.CENTER);
  panel.add(createToolbar(),BorderLayout.NORTH);
  panel.setPreferredSize(new Dimension(640,480));
  newShellLine();
  worker=new ScriptWorker(null);
  worker.start();
  return panel;
}
 

Example 42

From project LanguageSpecCreator, under directory /src/SpecificationCreation/.

Source file: SpecificationCreator.java

  17 
vote

/** 
 * Creates the initial welcome and starting screen
 */
private void init(Container c){
  topMenu=new JMenuBar();
  JMenu fileMenu=new JMenu("File");
  fileMenu.setMnemonic(KeyEvent.VK_ALT);
  topMenu.add(fileMenu);
  newItem=new JMenuItem("New project",KeyEvent.VK_N);
  newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,ActionEvent.CTRL_MASK));
  newItem.addActionListener(this);
  fileMenu.add(newItem);
  openItem=new JMenuItem("Open project",KeyEvent.VK_O);
  openItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,ActionEvent.CTRL_MASK));
  openItem.addActionListener(this);
  fileMenu.add(openItem);
  saveItem=new JMenuItem("Save project",KeyEvent.VK_S);
  saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,ActionEvent.CTRL_MASK));
  saveItem.addActionListener(this);
  fileMenu.add(saveItem);
  exitItem=new JMenuItem("Exit",KeyEvent.VK_Q);
  exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,ActionEvent.CTRL_MASK));
  exitItem.addActionListener(this);
  fileMenu.add(exitItem);
  setJMenuBar(topMenu);
  GridBagConstraints constraint=new GridBagConstraints();
  JTextArea area=new JTextArea("Welcome to the LIBER ontology preparation tool. " + "Please open an existing project, or start a new project by uploading the ontology you wish to adapt for use in LIBER.");
  area.setEditable(false);
  area.setLineWrap(true);
  area.setWrapStyleWord(true);
  constraint.insets=new Insets(0,10,10,0);
  constraint.anchor=GridBagConstraints.CENTER;
  constraint.gridx=0;
  constraint.gridy=0;
  c.add(area,constraint);
}
 

Example 43

From project Maimonides, under directory /src/com/codeko/apps/maimonides/.

Source file: MaimonidesInputBlocker.java

  17 
vote

private void recreateOptionPaneMessage(JOptionPane optionPane){
  Object message=optionPane.getMessage();
  if (message instanceof String) {
    Font font=optionPane.getFont();
    final JTextArea textArea=new JTextArea((String)message);
    textArea.setFont(font);
    int lh=textArea.getFontMetrics(font).getHeight();
    Insets margin=new Insets(0,0,lh,24);
    textArea.setMargin(margin);
    textArea.setEditable(false);
    textArea.setWrapStyleWord(true);
    textArea.setBackground(optionPane.getBackground());
    JPanel panel=new JPanel(new BorderLayout());
    panel.add(textArea,BorderLayout.CENTER);
    final JProgressBar progressBar=new JProgressBar();
    progressBar.setName("BlockingDialog.progressBar");
    progressBar.setIndeterminate(true);
    PropertyChangeListener taskPCL=new PropertyChangeListener(){
      public void propertyChange(      PropertyChangeEvent e){
        if ("progress".equals(e.getPropertyName())) {
          progressBar.setIndeterminate(false);
          progressBar.setValue((Integer)e.getNewValue());
          updateStatusBarString(progressBar);
        }
 else         if ("message".equals(e.getPropertyName())) {
          textArea.setText((String)e.getNewValue());
        }
      }
    }
;
    getTask().addPropertyChangeListener(taskPCL);
    panel.add(progressBar,BorderLayout.SOUTH);
    injectBlockingDialogComponents(panel);
    optionPane.setMessage(panel);
  }
}
 

Example 44

From project mtc, under directory /mtc-gui/src/main/java/org/drugis/mtc/gui/.

Source file: AboutDialog.java

  17 
vote

private void initComponents(){
  setLayout(new BorderLayout());
  Border border=BorderFactory.createEmptyBorder(5,5,5,5);
  String title=AppInfo.getAppName() + " " + AppInfo.getAppVersion();
  JLabel titleLabel=new JLabel(title);
  titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
  Font font=titleLabel.getFont();
  font=font.deriveFont(Font.BOLD,14F);
  titleLabel.setFont(font);
  titleLabel.setBorder(border);
  add(titleLabel,BorderLayout.NORTH);
  String aboutText="GeMTC is open source software for Mixed Treatment Comparison model generation.\n" + "Copyright \u00A92009-2012 Gert van Valkenhoef\n\n" + "Get GeMTC at <http://drugis.org/mtc>.\n\n"+ "This program is free software: you can redistribute it and/or modify "+ "it under the terms of the GNU General Public License as published by "+ "the Free Software Foundation, either version 3 of the License, or "+ "(at your option) any later version.\n\n"+ "This program is distributed in the hope that it will be useful, "+ "but WITHOUT ANY WARRANTY; without even the implied warranty of "+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "+ "GNU General Public License for more details.\n\n"+ "You should have received a copy of the GNU General Public License "+ "along with this program.  If not, see <http://www.gnu.org/licenses/>.";
  JTextArea textArea=new JTextArea(aboutText);
  textArea.setPreferredSize(new Dimension(400,400));
  textArea.setWrapStyleWord(true);
  textArea.setLineWrap(true);
  textArea.setEditable(false);
  textArea.setOpaque(false);
  textArea.setBorder(border);
  add(textArea,BorderLayout.CENTER);
  JLabel logoLabel=new JLabel(MainWindow.IMAGELOADER.getIcon("gemtc.png"));
  logoLabel.setBorder(border);
  add(logoLabel,BorderLayout.EAST);
  JButton closeButton=new JButton("Close");
  closeButton.setMnemonic('c');
  closeButton.addActionListener(new AbstractAction(){
    private static final long serialVersionUID=4493415703789106001L;
    public void actionPerformed(    ActionEvent arg0){
      dispose();
    }
  }
);
  add(closeButton,BorderLayout.SOUTH);
}
 

Example 45

From project OWASP-WebScarab, under directory /src/org/owasp/webscarab/plugin/proxy/swing/.

Source file: BeanShellPanel.java

  17 
vote

public void actionPerformed(ActionEvent ae){
  JTextArea comp=(JTextArea)ae.getSource();
  Document doc=comp.getDocument();
  if (!comp.isEditable())   return;
  try {
    int line=comp.getLineOfOffset(comp.getCaretPosition());
    int start=comp.getLineStartOffset(line);
    int end=comp.getLineEndOffset(line);
    String str=doc.getText(start,end - start - 1);
    String whiteSpace=getLeadingWhiteSpace(str);
    doc.insertString(comp.getCaretPosition(),'\n' + whiteSpace,null);
  }
 catch (  BadLocationException ex) {
    try {
      doc.insertString(comp.getCaretPosition(),"\n",null);
    }
 catch (    BadLocationException ignore) {
    }
  }
}
 

Example 46

From project packetsamurai, under directory /src/com/l2j/packetsamurai/gui/.

Source file: ConsoleTab.java

  17 
vote

public ConsoleTab(){
  this.setLayout(_layout);
  _cons.fill=GridBagConstraints.BOTH;
  _cons.weightx=1;
  _cons.weighty=1;
  _cons.insets=new Insets(5,5,5,5);
  _textPane=new JTextArea();
  _textPane.setEditable(false);
  _textPane.setAutoscrolls(true);
  this.add(new JScrollPane(_textPane,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED),_cons);
}
 

Example 47

From project sikuli, under directory /sikuli-script/src/test/java/org/sikuli/script/.

Source file: KeyEventDemo.java

  17 
vote

public KeyEventDemo(){
  super(new BorderLayout());
  JButton button=new JButton("Clear");
  button.addActionListener(this);
  typingArea=new JTextField(20);
  typingArea.addKeyListener(this);
  displayArea=new JTextArea();
  displayArea.setEditable(false);
  JScrollPane scrollPane=new JScrollPane(displayArea);
  scrollPane.setPreferredSize(new Dimension(375,125));
  add(typingArea,BorderLayout.PAGE_START);
  add(scrollPane,BorderLayout.CENTER);
  add(button,BorderLayout.PAGE_END);
}
 

Example 48

From project skmclauncher, under directory /src/main/java/com/sk89q/mclauncher/util/.

Source file: ConsoleFrame.java

  17 
vote

/** 
 * Build the interface.
 */
private void buildUI(){
  if (colorEnabled) {
    JTextPane text=new JTextPane();
    this.textComponent=text;
  }
 else {
    JTextArea text=new JTextArea();
    this.textComponent=text;
    text.setLineWrap(true);
  }
  textComponent.setFont(UIUtil.getMonospaceFont());
  textComponent.setEditable(false);
  DefaultCaret caret=(DefaultCaret)textComponent.getCaret();
  caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
  document=textComponent.getDocument();
  document.addDocumentListener(new LimitLinesDocumentListener(numLines,true));
  JScrollPane scrollText=new JScrollPane(textComponent);
  scrollText.setBorder(null);
  scrollText.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  add(scrollText,BorderLayout.CENTER);
}
 

Example 49

From project SMC, under directory /plugin-testing/src/main/java/example_5/.

Source file: TaskMessages.java

  17 
vote

public TaskMessages(int level){
  TaskController control=new TaskController();
  Locale currentLocale=new Locale("en","US");
  _timestampFormat=new SimpleDateFormat("MM/dd/yyyy hh:mm:ss",currentLocale);
  _level=level;
  _messageArea=new JTextArea(ROW_COUNT,COL_COUNT);
  _messageArea.setEditable(false);
  _messageArea.setFont(new Font("Courier",Font.PLAIN,10));
  _pane=new JScrollPane(_messageArea);
  control.register("Message GUI",this);
}
 

Example 50

From project smc-fork, under directory /examples/Ant/EX5/src/.

Source file: TaskMessages.java

  17 
vote

public TaskMessages(int level){
  TaskController control=new TaskController();
  Locale currentLocale=new Locale("en","US");
  _timestampFormat=new SimpleDateFormat("MM/dd/yyyy hh:mm:ss",currentLocale);
  _level=level;
  _messageArea=new JTextArea(ROW_COUNT,COL_COUNT);
  _messageArea.setEditable(false);
  _messageArea.setFont(new Font("Courier",Font.PLAIN,10));
  _pane=new JScrollPane(_messageArea);
  control.register("Message GUI",this);
}
 

Example 51

From project SpoutcraftLauncher, under directory /src/main/java/org/spoutcraft/launcher/skin/.

Source file: ConsoleFrame.java

  17 
vote

/** 
 * Build the interface.
 */
private void buildUI(){
  if (colorEnabled) {
    JTextPane text=new JTextPane();
    this.textComponent=text;
  }
 else {
    JTextArea text=new JTextArea();
    this.textComponent=text;
    text.setLineWrap(true);
  }
  textComponent.addMouseListener(this);
  textComponent.setFont(getMonospaceFont());
  textComponent.setEditable(false);
  DefaultCaret caret=(DefaultCaret)textComponent.getCaret();
  caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
  document=textComponent.getDocument();
  document.addDocumentListener(new LimitLinesDocumentListener(numLines,true));
  JScrollPane scrollText=new JScrollPane(textComponent);
  scrollText.setBorder(null);
  scrollText.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  add(scrollText,BorderLayout.CENTER);
}
 

Example 52

From project SPREAD, under directory /src/gui/.

Source file: TerminalTab.java

  17 
vote

public TerminalTab(){
  setLayout(new BoxLayout(this,BoxLayout.LINE_AXIS));
  textArea=new JTextArea();
  textArea.setEditable(true);
  textArea.setLineWrap(true);
  textArea.setWrapStyleWord(true);
  JScrollPane scrollPane=new JScrollPane(textArea,ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  add(scrollPane,BorderLayout.CENTER);
  System.setOut(new PrintStream(new JTextAreaOutputStream(textArea)));
  System.setErr(new PrintStream(new JTextAreaOutputStream(textArea)));
}
 

Example 53

From project subsonic, under directory /subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/mac/.

Source file: StatusPanel.java

  17 
vote

private void createComponents(){
  startedTextField=new JTextField();
  memoryTextField=new JTextField();
  errorTextField=new JTextArea(3,24);
  urlButton=new JButton();
}
 

Example 54

From project subsonic_1, under directory /subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/mac/.

Source file: StatusPanel.java

  17 
vote

private void createComponents(){
  startedTextField=new JTextField();
  memoryTextField=new JTextField();
  errorTextField=new JTextArea(3,24);
  urlButton=new JButton();
}
 

Example 55

From project subsonic_2, under directory /subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/mac/.

Source file: StatusPanel.java

  17 
vote

private void createComponents(){
  startedTextField=new JTextField();
  memoryTextField=new JTextField();
  errorTextField=new JTextArea(3,24);
  urlButton=new JButton();
}
 

Example 56

From project Supersonic, under directory /subsonic-booter/src/main/java/net/sourceforge/subsonic/booter/mac/.

Source file: StatusPanel.java

  17 
vote

private void createComponents(){
  startedTextField=new JTextField();
  memoryTextField=new JTextField();
  errorTextField=new JTextArea(3,24);
  urlButton=new JButton();
}
 

Example 57

From project thinklab, under directory /plugins/org.integratedmodelling.thinklab.thinkscape/src/org/integratedmodelling/thinkscape/.

Source file: ShellPanel.java

  17 
vote

/** 
 * This method initializes sessionTextArea	
 * @return javax.swing.JTextArea	
 */
private JTextArea getSessionTextArea(){
  if (sessionTextArea == null) {
    sessionTextArea=new JTextArea();
    sessionTextArea.setBounds(new Rectangle(13,74,191,327));
    sessionTextArea.setLineWrap(true);
  }
  return sessionTextArea;
}
 

Example 58

From project tomighty, under directory /tomighty-swing/src/main/java/org/tomighty/ui/about/.

Source file: AboutDialog.java

  17 
vote

private Component text(){
  license=new JTextArea();
  license.setFont(getFont());
  license.setBackground(getBackground());
  license.setEditable(false);
  license.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.GRAY),emptyBorder()));
  return license;
}
 

Example 59

From project tomighty-achievements, under directory /src/main/java/org/tomighty/ui/about/.

Source file: AboutDialog.java

  17 
vote

private Component text(){
  license=new JTextArea();
  license.setFont(getFont());
  license.setBackground(getBackground());
  license.setEditable(false);
  license.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.GRAY),emptyBorder()));
  return license;
}
 

Example 60

From project trademaker, under directory /src/org/lifeform/service/.

Source file: FileServer.java

  17 
vote

public FileServer(){
  copyButton=new JButton("Copy Files");
  copyButton.addActionListener(this);
  JPanel buttonPanel=new JPanel();
  buttonPanel.add(copyButton);
  console=new JTextArea(15,60);
  console.setMargin(new Insets(5,5,5,5));
  console.setEditable(false);
  add(new JScrollPane(console),BorderLayout.CENTER);
  add(buttonPanel,BorderLayout.SOUTH);
}
 

Example 61

From project Twister, under directory /src/client/userinterface/java/src/.

Source file: Plugins.java

  17 
vote

public void showReadMore(String description){
  JFrame frame=new JFrame("Read More");
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  JTextArea tdescription=new JTextArea();
  tdescription.setText(description);
  tdescription.setFont(new Font("Monospaced",0,14));
  tdescription.setEditable(false);
  tdescription.setLineWrap(true);
  tdescription.setTabSize(4);
  tdescription.setWrapStyleWord(true);
  tdescription.setAutoscrolls(false);
  tdescription.setOpaque(false);
  frame.add(new JScrollPane(tdescription));
  frame.setBounds(200,100,800,600);
  frame.setVisible(true);
}
 

Example 62

From project uniquery, under directory /src/org/uniquery/gui/.

Source file: Gui.java

  17 
vote

private void buildConsole(){
  console=new JTextArea(5,50);
  console.setEditable(false);
  console.setAutoscrolls(true);
  console.setForeground(Color.RED);
  console.setBackground(Color.WHITE);
}
 

Example 63

From project upm-swing, under directory /src/com/_17od/upm/gui/.

Source file: AboutDialog.java

  17 
vote

public AboutDialog(JFrame frame){
  super(frame,Translator.translate("aboutUPM"),true);
  String version=AboutDialog.class.getPackage().getImplementationVersion();
  if (version == null) {
    version="<version unknown>";
  }
  JPanel panel=new JPanel();
  panel.setLayout(new BoxLayout(panel,BoxLayout.PAGE_AXIS));
  JTextArea jTextArea=new JTextArea();
  StringBuffer aboutText=new StringBuffer();
  aboutText.append("Universal Password Manager\n");
  aboutText.append(version);
  aboutText.append("\n\n");
  aboutText.append("Copyright \u00a9 2005-2011 Adrian Smith & Contributors\n\n");
  aboutText.append("[email protected]\n");
  aboutText.append("http://upm.sourceforge.net");
  jTextArea.setText(aboutText.toString());
  jTextArea.setAlignmentX(Component.CENTER_ALIGNMENT);
  jTextArea.setEditable(false);
  jTextArea.setFont(new Font("Tahoma",Font.PLAIN,12));
  jTextArea.setBorder(BorderFactory.createEmptyBorder(8,8,8,8));
  panel.add(jTextArea);
  panel.add(new JSeparator());
  panel.add(Box.createRigidArea(new Dimension(0,10)));
  JButton okButton=new JButton(Translator.translate("ok"));
  okButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      setVisible(false);
      dispose();
    }
  }
);
  okButton.setAlignmentX(Component.CENTER_ALIGNMENT);
  panel.add(okButton);
  panel.add(Box.createRigidArea(new Dimension(0,10)));
  getContentPane().add(panel);
  setResizable(false);
}
 

Example 64

From project WCF-Package-Builder, under directory /src/com/wainox/wcf/pb/gui/.

Source file: PackageBuilderGUI.java

  17 
vote

public void printStackTrace(PrintStream s){
  final JFrame frame=new JFrame(Core.getLanguageItem("error"));
  frame.getContentPane().setLayout(new BorderLayout());
  JPanel panel=new JPanel();
  CompoundBorder rand=new CompoundBorder(new TitledBorder(Core.getLanguageItem("error")),new EmptyBorder(3,3,3,3));
  panel.setBorder(rand);
  panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
  JTextArea textArea=new JTextArea();
  textArea.append(this.getMessage() + "\n");
  for (  StackTraceElement element : this.getStackTrace()) {
    textArea.append("   " + element + "\n");
  }
  textArea.setCaretPosition(0);
  JScrollPane scrollPane=new JScrollPane(textArea);
  panel.add(scrollPane);
  frame.getContentPane().add(panel,BorderLayout.CENTER);
  JButton button=new JButton(Core.getLanguageItem("ok"));
  button.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent event){
      frame.dispose();
    }
  }
);
  frame.getContentPane().add(button,BorderLayout.SOUTH);
  frame.setPreferredSize(new Dimension(400,250));
  frame.pack();
  frame.setLocationRelativeTo(null);
  frame.setVisible(true);
}
 

Example 65

From project Clotho-Core, under directory /ClothoApps/LabEditor/src/org/clothocad/tool/labeditor/.

Source file: blueTextArea.java

  16 
vote

public blueTextArea(String fieldname,String initialvalue,int height){
  fieldName=fieldname;
  oldValue=initialvalue;
  setLayout(new BorderLayout());
  setMaximumSize(new Dimension(textfieldwidth + labelwidth,height));
  setPreferredSize(new Dimension(textfieldwidth + labelwidth,height));
  setOpaque(false);
  label=new JLabel(fieldName);
  label.setForeground(Color.WHITE);
  label.setFont(new java.awt.Font("Arial",Font.BOLD,textsize));
  label.setPreferredSize(new Dimension(labelwidth,2 * textsize));
  JPanel panel=new JPanel();
  panel.setOpaque(false);
  panel.add(label);
  add(panel,BorderLayout.WEST);
  textArea=new JTextArea();
  textArea.setBackground(navyblue);
  textArea.setFont(new java.awt.Font("Arial",Font.PLAIN,textsize));
  textArea.setForeground(Color.WHITE);
  textArea.setBorder(null);
  textArea.setText(initialvalue);
  textArea.setLineWrap(true);
  textArea.setWrapStyleWord(true);
  textArea.addFocusListener(this);
  textArea.setPreferredSize(new Dimension(textfieldwidth,2 * textsize));
  add(textArea,BorderLayout.EAST);
}
 

Example 66

From project gs-tool, under directory /src/org/graphstream/tool/gui/.

Source file: ReaderFromWindow.java

  16 
vote

public ReaderFromWindow(int width,int height){
  frame=new JDialog();
  buffer=new StringBuffer();
  text=new JTextArea(3,30);
  text.setFont(Resources.getMonospaceFont(14.0f));
  text.getKeymap().addActionForKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,KeyEvent.SHIFT_MASK),new FlushAction());
  pane=new JTextPane();
  pane.setSize(width,height);
  pane.setEditable(false);
  pane.setBackground(Resources.getColor(Resources.ColorType.BACKGROUND_RIGHT));
  pane.setFont(Resources.getMonospaceFont(14.0f));
  JScrollPane scroller1=new JScrollPane(pane);
  JScrollPane scroller2=new JScrollPane(text);
  JSplitPane split=new JSplitPane(JSplitPane.VERTICAL_SPLIT,scroller1,scroller2);
  scroller2.setPreferredSize(new Dimension(text.getPreferredSize().width,text.getPreferredSize().height + 5));
  scroller1.setPreferredSize(new Dimension(width,height - scroller2.getPreferredSize().height));
  split.resetToPreferredSizes();
  frame.add(split);
  frame.pack();
  frame.addWindowListener(new CloseHandler());
  frame.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
}
 

Example 67

From project huiswerk, under directory /print/zxing-1.6/javase/src/com/google/zxing/client/j2se/.

Source file: GUIRunner.java

  16 
vote

private GUIRunner(){
  imageLabel=new JLabel();
  textArea=new JTextArea();
  textArea.setEditable(false);
  textArea.setMaximumSize(new Dimension(400,200));
  Container panel=new JPanel();
  panel.setLayout(new FlowLayout());
  panel.add(imageLabel);
  panel.add(textArea);
  setTitle("ZXing");
  setSize(400,400);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setContentPane(panel);
  setLocationRelativeTo(null);
}
 

Example 68

From project JaamSim, under directory /com/sandwell/JavaSimulation3D/.

Source file: OrbitBehavior.java

  16 
vote

/** 
 * Creates a new OrbitBehavior
 * @param c The Canvas3D to add the behavior to
 * @param flags The option flags
 */
public OrbitBehavior(ModelView v,Sim3DWindow window){
  super(v.getCanvas3D(),MOUSE_LISTENER | MOUSE_MOTION_LISTENER);
  modelView=v;
  this.window=window;
  setEnable(true);
  orbitCenter=new Vector3d();
  orbitAngles=new Vector3d();
  orbitRadius=DEFAULT_RADIUS;
  fov=DEFAULT_FOV;
  integrateTransforms();
  Toolkit tk=Toolkit.getDefaultToolkit();
  Dimension dim=tk.getBestCursorSize(32,32);
  dim.height/=2;
  dim.width/=2;
  Image cursorImage=tk.getImage(GUIFrame.class.getResource("/resources/images/rotating.png"));
  try {
    rotation=tk.createCustomCursor(cursorImage,new Point(dim.width,dim.height),"Rotating");
  }
 catch (  Exception exc) {
    rotation=null;
  }
  tooltip=new JWindow();
  tooltip.setAlwaysOnTop(true);
  textArea=new JTextArea();
  textArea.setFocusable(false);
  textArea.setEditable(false);
  textArea.setFont(new Font("Verdana",Font.PLAIN,11));
  JPanel contentPane=(JPanel)tooltip.getContentPane();
  contentPane.setBorder(new LineBorder(Color.black));
  tooltip.getContentPane().add(textArea,BorderLayout.CENTER);
  tooltip.getContentPane().setBackground(new Color(255,255,198));
}
 

Example 69

From project james-mime4j, under directory /examples/src/main/java/org/apache/james/mime4j/samples/tree/.

Source file: MessageTree.java

  16 
vote

/** 
 * Creates a new <code>MessageTree</code> instance displaying the specified <code>Message</code>.
 * @param message the message to display.
 */
public MessageTree(Message message){
  super(new GridLayout(1,0));
  DefaultMutableTreeNode root=createNode(message);
  tree=new JTree(root);
  tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
  tree.addTreeSelectionListener(this);
  JScrollPane treeView=new JScrollPane(tree);
  contentPane=new JPanel(new GridLayout(1,0));
  JScrollPane contentView=new JScrollPane(contentPane);
  JSplitPane splitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
  splitPane.setLeftComponent(treeView);
  splitPane.setRightComponent(contentView);
  Dimension minimumSize=new Dimension(100,50);
  contentView.setMinimumSize(minimumSize);
  treeView.setMinimumSize(minimumSize);
  splitPane.setDividerLocation(250);
  splitPane.setPreferredSize(new Dimension(750,500));
  add(splitPane);
  textView=new JTextArea();
  textView.setEditable(false);
  textView.setLineWrap(true);
  contentPane.add(textView);
}
 

Example 70

From project JavaChat, under directory /ChatClient/src/UI/.

Source file: ChatUI.java

  16 
vote

public ChatUI(Contact c){
  this.c=c;
  UpdateTitle();
  setLayout(null);
  txtOutput=new JTextArea();
  txtInput=new JTextArea();
  paneOutput=new JScrollPane(txtOutput,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
  paneInput=new JScrollPane(txtInput,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  add(paneOutput);
  add(paneInput);
  paneOutput.setBounds(10,10,350,300);
  paneInput.setBounds(10,315,350,100);
  txtOutput.setEditable(false);
  setSize(375,450);
  setResizable(false);
  setLocationRelativeTo(null);
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  setVisible(true);
  addWindowListener(winListener);
  txtInput.addKeyListener(keyListener);
}
 

Example 71

From project jgraphx, under directory /src/com/mxgraph/swing/view/.

Source file: mxCellEditor.java

  16 
vote

/** 
 */
public mxCellEditor(mxGraphComponent graphComponent){
  this.graphComponent=graphComponent;
  textArea=new JTextArea();
  textArea.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
  textArea.setOpaque(false);
  editorPane=new JEditorPane();
  editorPane.setOpaque(false);
  editorPane.setContentType("text/html");
  editorPane.setEditorKit(new NoLinefeedHtmlEditorKit());
  scrollPane=new JScrollPane();
  scrollPane.setBorder(BorderFactory.createEmptyBorder());
  scrollPane.getViewport().setOpaque(false);
  scrollPane.setVisible(false);
  scrollPane.setOpaque(false);
  editorPane.getActionMap().put(CANCEL_EDITING,cancelEditingAction);
  textArea.getActionMap().put(CANCEL_EDITING,cancelEditingAction);
  editorPane.getActionMap().put(SUBMIT_TEXT,textSubmitAction);
  textArea.getActionMap().put(SUBMIT_TEXT,textSubmitAction);
  editorEnterActionMapKey=editorPane.getInputMap().get(enterKeystroke);
  textEnterActionMapKey=editorPane.getInputMap().get(enterKeystroke);
}
 

Example 72

From project jMemorize, under directory /src/jmemorize/gui/swing/dialogs/.

Source file: ErrorDialog.java

  16 
vote

private JPanel buildMainPanel(){
  FormLayout layout=new FormLayout("3dlu, p:grow, 3dlu","p, 3dlu, fill:p:grow, 3dlu");
  CellConstraints cc=new CellConstraints();
  DefaultFormBuilder builder=new DefaultFormBuilder(layout);
  builder.setBorder(new EmptyBorder(4,5,2,5));
  JLabel textLabel=builder.addLabel("<html>" + m_message + "</html>",cc.xy(2,1));
  textLabel.setIcon(new ImageIcon(getClass().getResource("/resource/icons/warn.gif")));
  textLabel.setBorder(new EmptyBorder(20,10,20,10));
  textLabel.setPreferredSize(new Dimension(500,90));
  textLabel.setFont(textLabel.getFont().deriveFont(16.0f));
  m_debugText=getDebugText(m_exception);
  m_stacktraceArea=new JTextArea(m_debugText);
  m_stacktraceArea.setEditable(false);
  m_scrollPane=new JScrollPane(m_stacktraceArea);
  m_scrollPane.setPreferredSize(new Dimension(500,300));
  m_placeholderPanel=new JPanel(new BorderLayout());
  builder.add(m_placeholderPanel,cc.xy(2,3));
  builder.setBorder(new EtchedBorder());
  return builder.getPanel();
}
 

Example 73

From project LateralGM, under directory /org/lateralgm/components/.

Source file: ErrorDialog.java

  16 
vote

public ErrorDialog(Frame parent,String title,String message,String debugInfo){
  super(parent,title,true);
  setResizable(false);
  this.debugInfo=new JTextArea(debugInfo);
  JScrollPane scroll=new JScrollPane(this.debugInfo);
  Dimension dim=new Dimension(scroll.getWidth(),DEBUG_HEIGHT);
  scroll.setPreferredSize(dim);
  copy=makeButton("ErrorDialog.COPY",this);
  ok=makeButton("ErrorDialog.OK",this);
  dim=new Dimension(Math.max(copy.getPreferredSize().width,ok.getPreferredSize().width),copy.getPreferredSize().height);
  copy.setPreferredSize(dim);
  ok.setPreferredSize(dim);
  JOptionPane wtfwjd=new JOptionPane(new Object[]{message,scroll},JOptionPane.ERROR_MESSAGE,JOptionPane.DEFAULT_OPTION,null,new JButton[]{copy,ok});
  add(wtfwjd);
  pack();
  setLocationRelativeTo(parent);
}
 

Example 74

From project lpped, under directory /src/controller/.

Source file: Console.java

  16 
vote

/** 
 * Initialize the console.
 */
public Console(CLI cli){
  this.cli=cli;
  setLayout(new BorderLayout());
  jtaConsole=new JTextArea(Data.FWELCOME + "\n");
  jtaConsole.setLineWrap(true);
  jtaConsole.setEditable(false);
  jtaConsole.setAutoscrolls(true);
  jtaConsole.setCaretPosition(Data.FWELCOME.length() + 1);
  jtaConsole.setFont(new Font("Monospaced",Font.PLAIN,12));
  jtaConsole.setBackground(super.getBackground());
  jspConsoleScroll=new JScrollPane(jtaConsole);
  add(jspConsoleScroll,BorderLayout.CENTER);
  jtfInput=new JTextField();
  jtfInput.setFont(new Font("Courier",Font.PLAIN,12));
  add(jtfInput,BorderLayout.PAGE_END);
  jtfInput.addKeyListener(new InputListener());
  cliHistory=new ArrayList<String>();
  p=0;
}
 

Example 75

From project Mobile-Tour-Guide, under directory /zxing-2.0/javase/src/com/google/zxing/client/j2se/.

Source file: GUIRunner.java

  16 
vote

private GUIRunner(){
  imageLabel=new JLabel();
  textArea=new JTextArea();
  textArea.setEditable(false);
  textArea.setMaximumSize(new Dimension(400,200));
  Container panel=new JPanel();
  panel.setLayout(new FlowLayout());
  panel.add(imageLabel);
  panel.add(textArea);
  setTitle("ZXing");
  setSize(400,400);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setContentPane(panel);
  setLocationRelativeTo(null);
}
 

Example 76

From project pegadi, under directory /storysketch/src/main/java/org/pegadi/storysketch/views/.

Source file: RDFTable.java

  16 
vote

public RDFItemCellRenderer(){
  titleLabel=new JLabel();
  titleLabel.setBorder(BorderFactory.createEmptyBorder(3,0,5,0));
  descriptionArea=new JTextArea();
  descriptionArea.setBorder(BorderFactory.createEmptyBorder(3,0,5,0));
  descriptionArea.setOpaque(false);
  descriptionArea.setLineWrap(true);
  descriptionArea.setWrapStyleWord(true);
  dateLabel=new JLabel();
  dateLabel.setBorder(BorderFactory.createEmptyBorder(3,0,5,0));
  setLayout(new BorderLayout());
  add(titleLabel,BorderLayout.NORTH);
  add(descriptionArea,BorderLayout.CENTER);
  add(dateLabel,BorderLayout.SOUTH);
  titleLabel.setFont(titleLabel.getFont().deriveFont((float)12).deriveFont(Font.BOLD));
  descriptionArea.setFont(descriptionArea.getFont().deriveFont((float)11));
  dateLabel.setFont(dateLabel.getFont().deriveFont((float)10));
}
 

Example 77

From project Pipeline, under directory /src/gui/variantTable/flexList/.

Source file: FlexListCellRenderer.java

  16 
vote

public FlexListCellRenderer(final FlexList list,String text){
  this.list=list;
  setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  this.setBorder(BorderFactory.createEmptyBorder(2,4,2,4));
  this.setBackground(Color.white);
  this.text=new JTextArea(text);
  this.text.setEditable(true);
  this.text.setBorder(BorderFactory.createEmptyBorder());
  this.text.setBackground(this.getBackground());
  this.text.setMinimumSize(new Dimension(50,30));
  this.text.setPreferredSize(new Dimension(200,30));
  this.text.setMaximumSize(new Dimension(1000,36));
  this.text.setRows(1);
  this.add(this.text);
  button=new BorderlessButton("X");
  button.setPreferredSize(new Dimension(28,28));
  button.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      removeThisItem();
    }
  }
);
  valSpinner=new JSpinner(new SpinnerNumberModel(1,1,10,1));
  valSpinner.setMaximumSize(new Dimension(40,28));
  this.add(valSpinner);
  this.add(button);
  this.setMaximumSize(new Dimension(500,36));
}
 

Example 78

From project RegexTagForMusic, under directory /src/org/essembeh/rtfm/gui/dialog/.

Source file: JobDialog.java

  16 
vote

public JobDialog(IJob job){
  this.job=job;
  this.model=new TreeMap<IMusicFile,ActionException>();
  this.textArea=new JTextArea();
  this.progressBar=new JProgressBar();
  for (  IMusicFile musicFile : job.getMusicFiles()) {
    model.put(musicFile,null);
  }
  setLayout(new BorderLayout());
  add(createNorth(),BorderLayout.NORTH);
  add(createCenter(),BorderLayout.CENTER);
  add(createSouth(),BorderLayout.SOUTH);
  setPreferredSize(new Dimension(800,600));
  setLocationRelativeTo(null);
  setTitle(Translator.get(StringId.HELLO));
  pack();
  job.addListener(new IJobListener(){
    @Override public void succeeded(    Workflow workflow,    IMusicFile musicFile){
      incrementProgressBar();
    }
    @Override public void start(    Workflow workflow){
synchronized (progressBar) {
        progressBar.setValue(0);
      }
    }
    @Override public void process(    Workflow workflow,    IMusicFile musicFile){
    }
    @Override public void error(    Workflow workflow,    IMusicFile musicFile,    ActionException e){
      incrementProgressBar();
      appendError(musicFile,e);
    }
    @Override public void end(    Workflow workflow){
      incrementProgressBar();
    }
  }
);
}
 

Example 79

From project RegexUtil, under directory /HtmlRegex/src/com/ess/regexutil/html/.

Source file: ToHtmlForm.java

  16 
vote

public ToHtmlForm(){
  super("Regex to html converter");
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  JPanel main=new JPanel(new BorderLayout());
  main.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  regexField=new JTextField();
  regexField.setFont(new Font("MonoSpaced",Font.PLAIN,12));
  main.add(regexField,BorderLayout.PAGE_START);
  resTextArea=new JTextArea();
  resTextArea.setFont(new Font("MonoSpaced",Font.PLAIN,12));
  main.add(new JScrollPane(resTextArea),BorderLayout.CENTER);
  JPanel btnPanel=new JPanel();
  JButton convertBtn=new JButton("Convert");
  convertBtn.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      convert();
    }
  }
);
  btnPanel.add(convertBtn);
  main.add(btnPanel,BorderLayout.PAGE_END);
  setContentPane(main);
  getRootPane().setDefaultButton(convertBtn);
  setSize(900,700);
  setLocationRelativeTo(getParent());
}
 

Example 80

From project replication-benchmarker, under directory /src/main/java/jbenchmarker/.

Source file: TraceViewer.java

  16 
vote

public TraceViewer(String file){
  windows++;
  text=new JTextArea(5,20);
  this.setTitle("TraceViwer " + (file == null ? "" : " [" + file + "]"));
  this.setBounds(0,0,500,500);
  JScrollPane bar=new JScrollPane(text);
  this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
  this.addWindowListener(new WindowAdapter(){
    @Override public void windowClosing(    WindowEvent e){
      windows--;
      if (windows == 0) {
        System.exit(0);
      }
    }
  }
);
  this.add(bar);
  if (file != null) {
    this.open(file);
  }
  this.setVisible(true);
}
 

Example 81

From project Sagan-1, under directory /src/pro/carl/edu/sagan1/gui/viewcon/.

Source file: CommunicationJPanel.java

  16 
vote

/** 
 * Constructor building up the panel outfit.
 */
CommunicationJPanel(){
  super(new BorderLayout());
  CommunicationJPanel myself=this;
  helpTextPanel=new JPanel(new BorderLayout(0,3));
  add(helpTextPanel,BorderLayout.NORTH);
  helpTextLine=new JLabel(i18n("panel.sysout.helpline"),SwingConstants.LEFT);
  helpTextPanel.add(helpTextLine,BorderLayout.NORTH);
  logArea=new JTextArea();
  logArea.setDocument(new LogDocument());
  logArea.setEditable(false);
  logArea.setLineWrap(true);
  logArea.setWrapStyleWord(true);
  scrollLogArea=new JScrollPane(logArea,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
  add(scrollLogArea,BorderLayout.CENTER);
  clearButton=new JButton("Clear");
  clearButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent evt){
      logArea.setText("");
    }
  }
);
  rp6loaderButton=new JButton("Start RP6Loader");
  rp6loaderButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent evt){
      MasterMind.getInstance().startRP6LoaderApplic();
    }
  }
);
  buttonPanel=new JPanel();
  buttonPanel.add(clearButton);
  buttonPanel.add(rp6loaderButton);
  add(buttonPanel,BorderLayout.SOUTH);
  MasterMind.getInstance().addCompilationNotificationListener(myself);
}
 

Example 82

From project SOCIETIES-SCE-Services, under directory /3rdPartyServices/DisasterManagement/AnalyzeThis/src/main/java/org/societies/thirdPartyServices/disasterManagement/analyzeThis/.

Source file: AnalyzeThis.java

  16 
vote

public AnalyzeThis(){
  LOG.info("*** " + this.getClass() + " instantiated");
  xmlrpcClient=new XMLRPCClient();
  UIManager.put("ClassLoader",ClassLoader.getSystemClassLoader());
  frame=new JFrame("AnalyzeThisFrame");
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.getContentPane().add(new JLabel("subscribe to DLR platform"),BorderLayout.NORTH);
  subscribe=new JButton("subscribe");
  subscribe.setPreferredSize(new Dimension(200,30));
  subscribe.addActionListener(this);
  frame.getContentPane().add(subscribe,BorderLayout.CENTER);
  textArea=new JTextArea("");
  DefaultCaret caret=(DefaultCaret)textArea.getCaret();
  caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
  JScrollPane scrollPane=new JScrollPane(textArea);
  JPanel panel=new JPanel(new BorderLayout());
  panel.setPreferredSize(new Dimension(600,200));
  panel.add(scrollPane);
  frame.getContentPane().add(panel,BorderLayout.SOUTH);
}
 

Example 83

From project spring-amqp-samples, under directory /stocks/src/main/java/org/springframework/amqp/rabbit/stocks/ui/.

Source file: StockPanel.java

  16 
vote

public StockPanel(StockController controller){
  this.stockController=controller;
  controller.setStockPanel(this);
  this.setBorder(BorderFactory.createTitledBorder("Stock Form"));
  FormLayout formLayout=new FormLayout("pref, 150dlu","pref, fill:100dlu:grow");
  setLayout(formLayout);
  CellConstraints c=new CellConstraints();
  tradeRequestButton=new JButton("Send Trade Request");
  add(tradeRequestButton,c.xy(1,1));
  tradeRequestTextField=new JTextField("");
  add(tradeRequestTextField,c.xy(2,1));
  add(new JLabel("Market Data"),c.xy(1,2));
  marketDataTextArea=new JTextArea();
  JScrollPane sp=new JScrollPane(marketDataTextArea);
  sp.setSize(200,300);
  add(sp,c.xy(2,2));
  tradeRequestTextField.addFocusListener(new FocusListener(){
    public void focusLost(    FocusEvent e){
    }
    public void focusGained(    FocusEvent e){
      tradeRequestTextField.setText("");
      tradeRequestTextField.setForeground(Color.BLACK);
    }
  }
);
  tradeRequestButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      sendTradeRequest();
    }
  }
);
}
 

Example 84

From project spring-flex, under directory /spring-flex-samples/spring-flex-testdrive/testdrive/src/main/java/org/springframework/flex/samples/jmschat/.

Source file: JMSChat.java

  16 
vote

public JMSChat(){
  try {
    ActiveMQConnectionFactory factory=new ActiveMQConnectionFactory(this.url);
    this.connection=factory.createConnection();
    this.session=this.connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
    this.topic=this.session.createTopic("sampletopic.flex.jms.chat");
    MessageConsumer consumer=this.session.createConsumer(this.topic);
    consumer.setMessageListener(this);
    this.producer=this.session.createProducer(this.topic);
    this.producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
    this.connection.start();
  }
 catch (  JMSException e) {
    e.printStackTrace();
  }
  JFrame frame=new JFrame("JMS Chat");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  this.taChat=new JTextArea();
  frame.getContentPane().add(this.taChat,BorderLayout.CENTER);
  Box north=new Box(BoxLayout.X_AXIS);
  north.add(new JLabel("User Name:"));
  this.tfUser=new JTextField();
  north.add(this.tfUser);
  frame.getContentPane().add(north,BorderLayout.NORTH);
  Box south=new Box(BoxLayout.X_AXIS);
  south.add(new JLabel("Message:"));
  this.tfMessage=new JTextField();
  south.add(this.tfMessage);
  JButton btSend=new JButton("Send");
  btSend.addActionListener(this);
  south.add(btSend);
  frame.getContentPane().add(south,BorderLayout.SOUTH);
  int width=300;
  int height=300;
  frame.setSize(width,height);
  frame.setVisible(true);
}
 

Example 85

From project verdandi, under directory /src/main/java/verdandi/ui/.

Source file: ErrorDialog.java

  16 
vote

private void initControls(){
  JPanel panel=new JPanel(new GridBagLayout());
  GridBagConstraints c=new GridBagConstraints();
  c.insets=new Insets(5,5,5,5);
  c.gridx=c.gridy=0;
  c.gridwidth=2;
  c.fill=GridBagConstraints.HORIZONTAL;
  c.anchor=GridBagConstraints.NORTHWEST;
  c.weightx=1.0;
  c.weighty=1.0;
  messageField=new JTextArea(message);
  messageField.setEditable(false);
  messageField.setBorder(BorderFactory.createEmptyBorder());
  panel.add(messageField,c);
  c.gridy=c.gridx=1;
  c.gridwidth=1;
  c.fill=GridBagConstraints.NONE;
  c.anchor=GridBagConstraints.NORTHEAST;
  btnDetails=new JButton(LABEL_DETAILS_SHOW);
  btnDetails.setActionCommand(CMD_DETAILS_SHOW);
  btnDetails.addActionListener(this);
  panel.add(btnDetails,c);
  c.gridx=0;
  c.gridy=2;
  c.gridwidth=2;
  c.fill=GridBagConstraints.BOTH;
  c.anchor=GridBagConstraints.NORTH;
  StringWriter sw=new StringWriter();
  PrintWriter pw=new PrintWriter(sw);
  cause.printStackTrace(pw);
  causeField=new JTextArea(sw.toString());
  causeField.setVisible(false);
  panel.add(causeField,c);
  panel.setBorder(BorderFactory.createLineBorder(Color.BLACK));
  this.getContentPane().add(panel,BorderLayout.CENTER);
  pack();
}
 

Example 86

From project zxing, under directory /javase/src/com/google/zxing/client/j2se/.

Source file: GUIRunner.java

  16 
vote

private GUIRunner(){
  imageLabel=new JLabel();
  textArea=new JTextArea();
  textArea.setEditable(false);
  textArea.setMaximumSize(new Dimension(400,200));
  Container panel=new JPanel();
  panel.setLayout(new FlowLayout());
  panel.add(imageLabel);
  panel.add(textArea);
  setTitle("ZXing");
  setSize(400,400);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setContentPane(panel);
  setLocationRelativeTo(null);
}
 

Example 87

From project zxing-iphone, under directory /javase/src/com/google/zxing/client/j2se/.

Source file: GUIRunner.java

  16 
vote

private GUIRunner(){
  imageLabel=new JLabel();
  textArea=new JTextArea();
  textArea.setEditable(false);
  textArea.setMaximumSize(new Dimension(400,200));
  Container panel=new JPanel();
  panel.setLayout(new FlowLayout());
  panel.add(imageLabel);
  panel.add(textArea);
  setTitle("ZXing");
  setSize(400,400);
  setDefaultCloseOperation(EXIT_ON_CLOSE);
  setContentPane(panel);
  setLocationRelativeTo(null);
}
 

Example 88

From project codjo-broadcast, under directory /codjo-broadcast-gui/src/main/java/net/codjo/broadcast/gui/.

Source file: BroadcastColumnsDetailWindow.java

  15 
vote

FunctionsPopupHelper(JTextArea expression,java.util.List functions,TranslationNotifier translationNotifier){
  JMenu funcs=new JMenu("Fonctions");
  translationNotifier.addInternationalizableComponent(funcs,"BroadcastColumnsDetailWindow.functions",null);
  popupMenu.add(funcs);
  for (  Object function : functions) {
    addItem(funcs,(String)function);
  }
  this.expr=expression;
  JMenu values=new JMenu("Valeurs");
  translationNotifier.addInternationalizableComponent(values,"BroadcastColumnsDetailWindow.values",null);
  popupMenu.add(values);
  addItem(values,"Valeur");
  addItem(values,"Valeur_nulle");
  expr.addMouseListener(this);
}
 

Example 89

From project collaborative-editor, under directory /mpedit/gui/.

Source file: CFileActions.java

  15 
vote

/** 
 * @param fileName Where do you want to save your document ?
 * @return Returns true if nothing went wrong , false if the opposite is correct
 */
public boolean saveDocument(String fileName,JTextArea textarea){
  boolean trueOrFalse=false;
  StringBuffer textBuffer=new StringBuffer(textarea.getText());
  try {
    PrintWriter outFile=new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
    outFile.print(textBuffer.toString() + "\n");
    outFile.close();
    trueOrFalse=true;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return trueOrFalse;
}
 

Example 90

From project Enterprise-Application-Samples, under directory /CCA/PushApp/src/eclserver/threads/.

Source file: ContactsLoader.java

  15 
vote

public ContactsLoader(ContactsDao addressDao,ContactsPanel contactsPanel,JTextArea resultsBox,String group,File source){
  this.resultsBox=resultsBox;
  this.groupName=group;
  this.source=source;
  this.addressDao=addressDao;
  this.contactsPanel=contactsPanel;
}
 

Example 91

From project maple-ide, under directory /build/windows/launcher/launch4j/src/net/sf/launch4j/binding/.

Source file: JTextAreaBinding.java

  15 
vote

public JTextAreaBinding(String property,JTextArea textArea){
  if (property == null || textArea == null) {
    throw new NullPointerException();
  }
  if (property.equals("")) {
    throw new IllegalArgumentException();
  }
  _property=property;
  _textArea=textArea;
  _validColor=_textArea.getBackground();
}
 

Example 92

From project rpiplanner, under directory /src/rpiplanner/view/.

Source file: CourseEditDialog.java

  15 
vote

protected void bind(){
  BeanProperty<JTextField,String> text=BeanProperty.create("text");
  BeanProperty<JTextArea,String> textArea=BeanProperty.create("text");
  BeanProperty<JComboBox,String> selectedItem=BeanProperty.create("selectedItem");
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("department"),departmentField,text).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("title"),titleField,text).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("catalogNumber"),catalogField,text).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("description"),descriptionTextArea,textArea).bind();
  Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,toEdit,BeanProperty.create("credits"),creditsComboBox,selectedItem).bind();
  StringBuilder builder=new StringBuilder();
  for (  Course c : toEdit.getPrerequisites())   builder.append(c.getCatalogNumber());
  prerequisitesField.setText(builder.toString());
  builder=new StringBuilder();
  for (  Course c : toEdit.getCorequisites())   builder.append(c.getCatalogNumber());
  corequisitesField.setText(builder.toString());
  for (  Component c : offeredDuringPanel.getComponents()) {
    JCheckBox box=(JCheckBox)c;
    box.setSelected(false);
    if (toEdit.getAvailableTerms() != null) {
      for (      YearPart t : toEdit.getAvailableTerms()) {
        if (box.getText().equals(t.toString()))         box.setSelected(true);
      }
    }
 else {
      box.setSelected(true);
    }
  }
}
 

Example 93

From project sradonia-tools, under directory /src/main/java/net/sradonia/log4j/.

Source file: DialogAppender.java

  15 
vote

/** 
 * Creates a new LogDialog ready for displaying a message via  {@link #showEvent(LoggingEvent)}.
 */
public LogDialog(final String header){
  try {
    EventQueue.invokeLater(new Runnable(){
      public void run(){
        JPanel panel=new JPanel(new BorderLayout());
        textArea=new JTextArea();
        textArea.setEditable(false);
        JScrollPane scrollPane=new JScrollPane(textArea);
        panel.add(new JLabel(header),BorderLayout.NORTH);
        panel.add(scrollPane,BorderLayout.CENTER);
        JOptionPane optionPane=new JOptionPane();
        optionPane.setMessage(panel);
        optionPane.setMessageType(JOptionPane.ERROR_MESSAGE);
        optionPane.setOptionType(JOptionPane.DEFAULT_OPTION);
        dialog=optionPane.createDialog(null,title);
        dialog.setSize(400,250);
        dialog.setLocationRelativeTo(null);
      }
    }
);
  }
 catch (  Exception e) {
    LogLog.error("couldn't create DialogAppender window",e);
  }
}