Java Code Examples for javax.swing.JTextArea#setEditable()

The following examples show how to use javax.swing.JTextArea#setEditable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShowPanel.java    From HubPlayer with GNU General Public License v3.0 6 votes vote down vote up
private void init() {
	libraryPanel = new LibraryPanel();

	// 歌词面板处理
	lrcPanel = new JPanel(new GridLayout());
	textArea = new JTextArea();

	// 文本域设置不可编辑、透明、左间距、自动换行
	textArea.setEditable(false);
	textArea.setLineWrap(true);
	textArea.setMargin(new Insets(0, 175, 0, 0));
	textArea.setOpaque(false);

	textArea.setFont(new Font("PLAN", Font.PLAIN, 14));
	lrcPanel.add(textArea);

	// 其他面板
	MVPanel = new JScrollPane(new JLabel("MV"));
	radioPanel = new JScrollPane(new JLabel("电台"));
	livePanel = new JScrollPane(new JLabel("直播"));
}
 
Example 2
Source File: RemarksPage.java    From software-demo with MIT License 6 votes vote down vote up
/**
 * Create the dialog.
 */
public RemarksPage(String remarks) {
	setBounds(100, 100, 450, 300);
	setModal(true);
	setLocationRelativeTo(null);
	getContentPane().setLayout(new BorderLayout());
	contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
	getContentPane().add(contentPanel, BorderLayout.CENTER);
	contentPanel.setLayout(null);
	
	JLabel label = new JLabel("备注");
	label.setFont(new Font("宋体", Font.PLAIN, 18));
	label.setBounds(193, 10, 54, 15);
	contentPanel.add(label);
	
	JTextArea textArea = new JTextArea();
	textArea.setFont(new Font("Monospaced", Font.PLAIN, 17));
	textArea.setEditable(false);
	textArea.setEnabled(false);
	textArea.setText(remarks);
	JScrollPane scrollPane = new JScrollPane(textArea);
	scrollPane.setBounds(10, 37, 414, 214);
	contentPanel.add(scrollPane);
}
 
Example 3
Source File: CounterRequestDetailPanel.java    From javamelody with Apache License 2.0 6 votes vote down vote up
private JPanel createStackTracePanel(String stackTrace) {
	final JTextArea textArea = new JTextArea();
	textArea.setFont(textArea.getFont().deriveFont((float) textArea.getFont().getSize() - 1));
	textArea.setEditable(false);
	textArea.setCaretPosition(0);
	// background nécessaire avec la plupart des look and feels dont Nimbus,
	// sinon il reste blanc malgré editable false
	textArea.setBackground(Color.decode("#E6E6E6"));
	textArea.setText(stackTrace);
	final JPanel panel = new JPanel(new BorderLayout());
	panel.setOpaque(false);
	final JLabel label = new JLabel("Stack-trace");
	label.setFont(label.getFont().deriveFont(Font.BOLD));
	panel.add(label, BorderLayout.NORTH);
	final JScrollPane scrollPane = new JScrollPane(textArea);
	panel.add(scrollPane, BorderLayout.CENTER);
	return panel;
}
 
Example 4
Source File: DesignSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
static JComponent warningPanel() throws MissingResourceException {
    JTextArea a = new JTextArea();
    a.setEditable(false);
    a.setText(org.openide.util.NbBundle.getMessage(BasicSettingsPanel.class, "MSG_ReallyLaunch", new Object[]{}));
    a.setOpaque(false);
    return a;
}
 
Example 5
Source File: ImageableAreaTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void createAndShowTestDialog(String description,
        String failMessage, Runnable action) {
    final JDialog dialog = new JDialog();
    dialog.setTitle("Test: " + (++testCount));
    dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);
    final JButton testButton = new JButton("Print Table");
    final JButton passButton = new JButton("PASS");
    passButton.setEnabled(false);
    passButton.addActionListener((e) -> {
        dialog.dispose();
    });
    final JButton failButton = new JButton("FAIL");
    failButton.setEnabled(false);
    failButton.addActionListener((e) -> {
        throw new RuntimeException(failMessage);
    });
    testButton.addActionListener((e) -> {
        testButton.setEnabled(false);
        action.run();
        passButton.setEnabled(true);
        failButton.setEnabled(true);
    });
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    buttonPanel.add(passButton);
    buttonPanel.add(failButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);
    dialog.pack();
    dialog.setVisible(true);
}
 
Example 6
Source File: AbstractDataMonitorView.java    From ET_Redux with Apache License 2.0 5 votes vote down vote up
private void rawDataFilePathTextFactory() throws IOException {
    // show rawdatafile path
    rawDataFilePathTextArea = new JTextArea(//
            "Monitoring Raw data location: "
            + rawDataFileHandler.getAcquisitionModel().getRawDataFile().getCanonicalPath());

    rawDataFilePathTextArea.setBounds(leftMargin + 50, topMargin, parentDimension.width - 100, 40);
    rawDataFilePathTextArea.setLineWrap(true);
    rawDataFilePathTextArea.setEditable(false);
    rawDataFilePathTextArea.setForeground(Color.RED);
    this.add(rawDataFilePathTextArea, JLayeredPane.DEFAULT_LAYER);
}
 
Example 7
Source File: PopupMenuDemoX.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public Container createContentPane() {
    // Create the content-pane-to-be.
    JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.setOpaque(true);

    // Create a scrolled text area.
    output = new JTextArea(5, 30);
    output.setEditable(false);
    scrollPane = new JScrollPane(output);

    // Add the text area to the content pane.
    contentPane.add(scrollPane, BorderLayout.CENTER);

    return contentPane;
}
 
Example 8
Source File: InfoPanel.java    From javagame with MIT License 5 votes vote down vote up
public InfoPanel() {
    // �p�l���̐����T�C�Y��ݒ�Apack()����Ƃ��ɕK�v
    setPreferredSize(new Dimension(320, 240));
    
    setLayout(new BorderLayout());
    infoArea = new JTextArea();
    infoArea.setEditable(true);
    infoArea.setLineWrap(true);

    add(new JScrollPane(infoArea), BorderLayout.CENTER);
}
 
Example 9
Source File: TextViewOOM.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void createAndShowGUI() {
    frame = new JFrame();
    final JScrollPane jScrollPane1 = new JScrollPane();
    ta = new JTextArea();

    ta.setEditable(false);
    ta.setColumns(20);
    ta.setRows(5);
    jScrollPane1.setViewportView(ta);
    frame.add(ta);

    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}
 
Example 10
Source File: GroovyJUnitTestWizard.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private JTextComponent createMultilineLabel(String text) {
    JTextArea textArea = new JTextArea(text);
    textArea.setEditable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    textArea.setEnabled(false);
    textArea.setOpaque(false);
    textArea.setColumns(25);
    textArea.setDisabledTextColor(new JLabel().getForeground());

    return textArea;
}
 
Example 11
Source File: PopupMenuDemo.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public Container createContentPane() {
    // Create the content-pane-to-be.
    JPanel contentPane = new JPanel(new BorderLayout());
    contentPane.setOpaque(true);

    // Create a scrolled text area.
    output = new JTextArea(5, 30);
    output.setEditable(false);
    scrollPane = new JScrollPane(output);

    // Add the text area to the content pane.
    contentPane.add(scrollPane, BorderLayout.CENTER);

    return contentPane;
}
 
Example 12
Source File: BetaFeaturesListener.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void windowClosed(WindowEvent e) {
	boolean betaActiveNow = Boolean
			.parseBoolean(ParameterService.getParameterValue(RapidMiner.PROPERTY_RAPIDMINER_UPDATE_BETA_FEATURES));
	if (!betaActiveBefore && betaActiveNow) {
		JTextArea textArea = new JTextArea();
		textArea.setColumns(60);
		textArea.setRows(15);
		textArea.setLineWrap(true);
		textArea.setWrapStyleWord(true);
		textArea.setEditable(false);
		textArea.setText(loadBetaEULA());
		textArea.setBorder(null);
		textArea.setCaretPosition(0);

		JScrollPane scrollPane = new ExtendedJScrollPane(textArea);
		scrollPane.setBorder(BorderFactory.createLineBorder(Colors.TEXTFIELD_BORDER));

		ButtonDialog dialog = new ButtonDialogBuilder("beta_features_eula")
				.setOwner(ApplicationFrame.getApplicationFrame())
				.setButtons(DefaultButtons.OK_BUTTON, DefaultButtons.CANCEL_BUTTON)
				.setModalityType(ModalityType.APPLICATION_MODAL).setContent(scrollPane, ButtonDialog.DEFAULT_SIZE)
				.build();
		dialog.setVisible(true);
		if (!dialog.wasConfirmed()) {
			ParameterService.setParameterValue(RapidMiner.PROPERTY_RAPIDMINER_UPDATE_BETA_FEATURES,
					String.valueOf(false));
			ParameterService.saveParameters();
			ActionStatisticsCollector.INSTANCE.log(ActionStatisticsCollector.TYPE_BETA_FEATURES,
					ActionStatisticsCollector.VALUE_BETA_FEATURES_ACTIVATION, "cancelled");
		}
	}
}
 
Example 13
Source File: ImageableAreaTest.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void createAndShowTestDialog(String description,
        String failMessage, Runnable action) {
    final JDialog dialog = new JDialog();
    dialog.setTitle("Test: " + (++testCount));
    dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);
    final JButton testButton = new JButton("Print Table");
    final JButton passButton = new JButton("PASS");
    passButton.setEnabled(false);
    passButton.addActionListener((e) -> {
        dialog.dispose();
    });
    final JButton failButton = new JButton("FAIL");
    failButton.setEnabled(false);
    failButton.addActionListener((e) -> {
        throw new RuntimeException(failMessage);
    });
    testButton.addActionListener((e) -> {
        testButton.setEnabled(false);
        action.run();
        passButton.setEnabled(true);
        failButton.setEnabled(true);
    });
    JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    buttonPanel.add(passButton);
    buttonPanel.add(failButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);
    dialog.pack();
    dialog.setVisible(true);
}
 
Example 14
Source File: TextViewOOM.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void createAndShowGUI() {
    frame = new JFrame();
    final JScrollPane jScrollPane1 = new JScrollPane();
    ta = new JTextArea();

    ta.setEditable(false);
    ta.setColumns(20);
    ta.setRows(5);
    jScrollPane1.setViewportView(ta);
    frame.add(ta);

    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}
 
Example 15
Source File: PerfMonGui.java    From jmeter-plugins with Apache License 2.0 5 votes vote down vote up
@Override
protected JPanel getGraphPanelContainer() {
    JPanel panel = new JPanel(new BorderLayout());
    JPanel innerTopPanel = new JPanel(new BorderLayout());

    errorPane = new JScrollPane();
    errorPane.setMinimumSize(new Dimension(100, 50));
    errorPane.setPreferredSize(new Dimension(100, 50));

    errorTextArea = new JTextArea();
    errorTextArea.setForeground(Color.red);
    errorTextArea.setBackground(new Color(255, 255, 153));
    errorTextArea.setEditable(false);
    errorPane.setViewportView(errorTextArea);

    registerPopup();

    innerTopPanel.add(createConnectionsPanel(), BorderLayout.NORTH);
    innerTopPanel.add(errorPane, BorderLayout.SOUTH);
    innerTopPanel.add(getFilePanel(), BorderLayout.CENTER);

    panel.add(innerTopPanel, BorderLayout.NORTH);

    errorPane.setVisible(false);

    return panel;
}
 
Example 16
Source File: TestSaveFileWithoutPrinter.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void createAndShowTestDialog() {
    String description =
        " To run this test it is required to delete any installed printers.\r\n" +
        "\r\n" +
        " 1. Verify that saving file via \"Save as PDF\" results in saving file\r\n" +
        " even if there is no installed printer.\r\n" +
        " 2. Click on \"Start Test\" button.\r\n" +
        " 3. In the shown print dialog select \"Save as PDF\" in PDF drop-down list\r\n" +
        " 4. Another dialog opens prompting for filename, enter any filename and press \"Save\".\r\n" +
        "\r\n" +
        " If the file is saved without any PrinterException, click on \"PASS\"\r\n" +
        " button, otherwise click on \"FAIL\" button.";

    final JDialog dialog = new JDialog();
    dialog.setTitle("SaveFileWithoutPrinter");
    dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    dialog.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            dialog.dispose();
            fail("Main dialog was closed.");
        }
    });

    final JLabel testTimeoutLabel = new JLabel(String.format(
        "Test timeout: %s", convertMillisToTimeStr(testTimeout)));
    final long startTime = System.currentTimeMillis();
    final Timer timer = new Timer(0, null);
    timer.setDelay(1000);
    timer.addActionListener((e) -> {
        int leftTime = testTimeout - (int) (System.currentTimeMillis() - startTime);
        if ((leftTime < 0) || testFinished) {
            timer.stop();
            dialog.dispose();
        }
        testTimeoutLabel.setText(String.format(
            "Test timeout: %s", convertMillisToTimeStr(leftTime)));
    });
    timer.start();

    JTextArea textArea = new JTextArea(description);
    textArea.setEditable(false);

    final JButton testButton = new JButton("Start Test");
    final JButton passButton = new JButton("PASS");
    final JButton failButton = new JButton("FAIL");
    testButton.addActionListener((e) -> {
        testButton.setEnabled(false);
        new Thread(() -> {
            try {
                doTest();

                SwingUtilities.invokeLater(() -> {
                    passButton.setEnabled(true);
                    failButton.setEnabled(true);
                });
            } catch (Throwable t) {
                t.printStackTrace();
                dialog.dispose();
                fail("Exception occurred in a thread executing the test.");
            }
        }).start();
    });
    passButton.setEnabled(false);
    passButton.addActionListener((e) -> {
        dialog.dispose();
        pass();
    });
    failButton.setEnabled(false);
    failButton.addActionListener((e) -> {
        dialog.dispose();
        fail("PrinterException thrown.");
    });

    JPanel mainPanel = new JPanel(new BorderLayout());
    JPanel labelPanel = new JPanel(new FlowLayout());
    labelPanel.add(testTimeoutLabel);
    mainPanel.add(labelPanel, BorderLayout.NORTH);
    mainPanel.add(textArea, BorderLayout.CENTER);
    JPanel buttonPanel = new JPanel(new FlowLayout());
    buttonPanel.add(testButton);
    buttonPanel.add(passButton);
    buttonPanel.add(failButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    dialog.add(mainPanel);

    dialog.pack();
    dialog.setVisible(true);
}
 
Example 17
Source File: LHPNEditor.java    From iBioSim with Apache License 2.0 4 votes vote down vote up
public void viewLhpn() {
	try {
		File work = new File(directory);
		if (new File(directory + File.separator + filename).exists()) {
			String dotFile = filename.replace(".lpn", ".dot");
			File dot = new File(directory + File.separator + dotFile);
			dot.delete();
			Preferences biosimrc = Preferences.userRoot();
			String command = biosimrc.get("biosim.general.graphviz", "");
			command = command + " " + dotFile;
			Runtime exec = Runtime.getRuntime();
			lhpnFile.printDot(directory + File.separator + dotFile);
			if (dot.exists()) {
				exec.exec(command, null, work);
			} else {
				File log = new File(directory + File.separator + "atacs.log");
				BufferedReader input = new BufferedReader(new FileReader(
						log));
				String line = null;
				JTextArea messageArea = new JTextArea();
				while ((line = input.readLine()) != null) {
					messageArea.append(line);
					messageArea
							.append(System.getProperty("line.separator"));
				}
				input.close();
				messageArea.setLineWrap(true);
				messageArea.setWrapStyleWord(true);
				messageArea.setEditable(false);
				JScrollPane scrolls = new JScrollPane();
				scrolls.setMinimumSize(new Dimension(500, 500));
				scrolls.setPreferredSize(new Dimension(500, 500));
				scrolls.setViewportView(messageArea);
				JOptionPane.showMessageDialog(Gui.frame, scrolls, "Log",
						JOptionPane.INFORMATION_MESSAGE);
			}
		} else {
			JOptionPane.showMessageDialog(this,
					"No circuit has been generated yet.", "Error",
					JOptionPane.ERROR_MESSAGE);
		}
	} catch (Exception e1) {
		e1.printStackTrace();
		JOptionPane.showMessageDialog(this, "Unable to view circuit.",
				"Error", JOptionPane.ERROR_MESSAGE);
	}
}
 
Example 18
Source File: InsertWktGeometryAction.java    From snap-desktop with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void actionPerformed(ActionEvent event) {
    JTextArea textArea = new JTextArea(16, 32);
    textArea.setEditable(true);

    JPanel contentPanel = new JPanel(new BorderLayout(4, 4));
    contentPanel.add(new JLabel("Geometry Well-Known-Text (WKT):"), BorderLayout.NORTH);
    contentPanel.add(new JScrollPane(textArea), BorderLayout.CENTER);

    SnapApp snapApp = SnapApp.getDefault();
    ModalDialog modalDialog = new ModalDialog(snapApp.getMainFrame(),
                                              Bundle.CTL_InsertWktGeometryAction_DialogTitle(),
                                              ModalDialog.ID_OK_CANCEL, null);
    modalDialog.setContent(contentPanel);
    modalDialog.center();
    if (modalDialog.show() == ModalDialog.ID_OK) {
        String wellKnownText = textArea.getText();
        if (wellKnownText == null || wellKnownText.isEmpty()) {
            return;
        }
        ProductSceneView sceneView = snapApp.getSelectedProductSceneView();
        VectorDataLayer vectorDataLayer = InsertFigureInteractorInterceptor.getActiveVectorDataLayer(sceneView);
        if (vectorDataLayer == null) {
            return;
        }

        SimpleFeatureType wktFeatureType = PlainFeatureFactory.createDefaultFeatureType(DefaultGeographicCRS.WGS84);
        ListFeatureCollection newCollection = new ListFeatureCollection(wktFeatureType);
        SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(wktFeatureType);
        SimpleFeature wktFeature = featureBuilder.buildFeature("ID" + Long.toHexString(currentFeatureId++));
        Geometry geometry;
        try {
            geometry = new WKTReader().read(wellKnownText);
        } catch (ParseException e) {
            snapApp.handleError("Failed to convert WKT into geometry", e);
            return;
        }
        wktFeature.setDefaultGeometry(geometry);
        newCollection.add(wktFeature);

        FeatureCollection<SimpleFeatureType, SimpleFeature> productFeatures = FeatureUtils.clipFeatureCollectionToProductBounds(
                newCollection,
                sceneView.getProduct(),
                null,
                ProgressMonitor.NULL);
        if (productFeatures.isEmpty()) {
            Dialogs.showError(Bundle.CTL_InsertWktGeometryAction_MenuText(),
                              "The geometry is not contained in the product.");
        } else {
            vectorDataLayer.getVectorDataNode().getFeatureCollection().addAll(productFeatures);
        }
    }
}
 
Example 19
Source File: TransferViewBuilder.java    From raccoon4 with Apache License 2.0 4 votes vote down vote up
@Override
protected JPanel assemble() {
	peers = new Vector<TransferPeerBuilder>();
	GridBagConstraints spacerConstraints = new GridBagConstraints();
	spacerConstraints.gridx = GridBagConstraints.REMAINDER;
	spacerConstraints.gridy = GridBagConstraints.RELATIVE;
	spacerConstraints.weightx = 1;
	spacerConstraints.weighty = 1;
	spacerConstraints.fill = GridBagConstraints.BOTH;

	list = new JPanel();
	list.setLayout(new GridBagLayout());
	contentConstraints = new GridBagConstraints();
	contentConstraints.gridx = GridBagConstraints.REMAINDER;
	contentConstraints.gridy = GridBagConstraints.RELATIVE;
	contentConstraints.fill = GridBagConstraints.HORIZONTAL;
	contentConstraints.anchor = GridBagConstraints.NORTH;
	contentConstraints.insets.bottom = 3;

	ActionLocalizer al = Messages.getLocalizer();
	trim = new JButton(al.localize("trimdownloads"));
	trim.addActionListener(this);
	list.add(new JPanel(), spacerConstraints);
	
	
	JPanel cont = new JPanel();
	cont.setLayout(new GridBagLayout());
	GridBagConstraints contgbc = new GridBagConstraints();
	if (!globals.get(Traits.class).isAvailable("4.0.x")) {
		JTextArea txt = new JTextArea(Messages.getString(ID + ".booster.plug"));
		txt.setLineWrap(true);
		txt.setWrapStyleWord(true);
		txt.setPreferredSize(new Dimension(ITEMWIDTH + 2 * 10,50));
		txt.setEditable(false);
		txt.setBackground(null);
		txt.setForeground(Color.RED);
		cont.add(txt,contgbc);
		contgbc.gridx=0;
		contgbc.gridy =1;
		contgbc.insets = new Insets(5,5,5,5);
		contgbc.anchor=GridBagConstraints.NORTHEAST;
		order=new JButton(Messages.getString(ID + ".booster.ok"));
		order.addActionListener(this);
		cont.add(order,contgbc);
		contgbc.gridy=2;
		contgbc.gridx=0;
	}

	JScrollPane tmp = new JScrollPane(list);
	tmp.setBorder(BorderFactory.createEmptyBorder());
	tmp.getVerticalScrollBar().setUnitIncrement(20);
	tmp.setPreferredSize(new Dimension(ITEMWIDTH + 2 * 10, 400));
	tmp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
	
	contgbc.weightx=1;
	contgbc.weighty=1;
	cont.add(tmp,contgbc);

	JPanel ret = new DialogBuilder(cont)
			.withTitle(Messages.getString(ID + ".title"))
			.withSubTitle(Messages.getString(ID + ".subtitle"))
			.withButtons(new ButtonBarBuilder().add(trim)).build(globals);

	globals.get(TransferManager.class).setPeer(this);
	return ret;
}
 
Example 20
Source File: Amf3ValueEditor.java    From jpexs-decompiler with GNU General Public License v3.0 4 votes vote down vote up
public Amf3ValueEditor(String fieldName, Object obj, Field field, int index, Class<?> type) {
    this.obj = obj;
    this.field = field;
    this.index = index;
    this.type = type;
    this.fieldName = fieldName;
    setPreferredSize(new Dimension(800, 200));
    setLayout(new BorderLayout());

    JPanel titlePanel = new JPanel(new BorderLayout()) {
        @Override
        public Insets getInsets() {
            Insets is = super.getInsets();
            is.left = 5;
            return is;
        }

    };
    JLabel titleLabel = new JLabel(AppStrings.translate("generic.editor.amf3.title"));
    titleLabel.setFont(titleLabel.getFont().deriveFont(Font.BOLD));
    titlePanel.add(titleLabel, BorderLayout.CENTER);
    JButton helpButton = new JButton(View.getIcon("about16"));
    helpButton.setFocusable(false);
    JTextArea txthelp = new JTextArea();
    txthelp.setFont(new Font("monospaced", Font.PLAIN, 12));

    final String SCALAR_SAMPLES = " * undefined, null, false, true\n"
            + " * integer : -5, 5, 29\n"
            + " * double: 5.5, 1.27, -187.568\n"
            + " * String: \"hello\", \"escape new\\nline\"\n";
    final String NONSCALAR_SAMPLES = " * XMLDocument: {\"type\":\"XMLDocument\", value: \"<foo></foo>\"}\n"
            + " * Date: {\"type\":\"Date\", \"value\": \"2016-07-17 14:51:42.584\"}\n"
            + " * Array: {\"type\":\"Array\", \"denseValues\": [27,58,99], \"associativeValues\": {\"key1\":5, \"key2\": -4.6 }}\n"
            + " * Object: {\"type\":\"Object\",\"className\":\"\",\"dynamic\":true,\n"
            + "            \"sealedMembers\": {\"smemberA\": \"abc\", \"smemberB\":987.5},\n"
            + "            \"dynamicMembers\": {\"member1\": 5, \"member2\": \"aaa\"}\n"
            + "            }\n"
            + " * XML: {\"type\":\"XML\", value: \"<foo></foo>\"}\n"
            + " * ByteArray: {\"type\":\"ByteArray\", \"value\":\"B0312F\"}\n"
            + " * Vector: {\"type\": \"Vector\", \"fixed\":false, \"subtype\":\"int\", \"values\": [8, 4, 6]}\n"
            + " * Dictionary: {\"type\": \"Dictionary\", \"weakKeys\":false, \"entries\": { \"dkey1\" : \"val1\", \"dkey2\": 56 }}\n";
    final String REFERENCE_SAMPLE = "  {\"type\": \"Vector\", \"fixed\":false, \"subtype\":\"\",\n"
            + "   \"values\": [\n"
            + "       {\"type\":\"Date\", id=\"mydate\",\"value\": \"2016-07-17 14:51:42.584\"}\n"
            + "       #mydate,\n"
            + "       #mydate,\n"
            + "       {\"type\":\"Date\", \"value\": \"2016-07-26 18:12:22.188\"}\n"
            + "    ]}";

    txthelp.setText(AppStrings.translate("generic.editor.amf3.help").replace("%scalar_samples%", SCALAR_SAMPLES).replace("%nonscalar_samples%", NONSCALAR_SAMPLES).replace("%reference_sample%", REFERENCE_SAMPLE));
    txthelp.setEditable(false);
    helpButton.addActionListener((ActionEvent e) -> {
        View.showMessageDialog(null, txthelp);
    });
    titlePanel.add(helpButton, BorderLayout.EAST);
    add(titlePanel, BorderLayout.NORTH);

    add(new JScrollPane(editor), BorderLayout.CENTER);
    add(errorLabel, BorderLayout.SOUTH);
    errorLabel.setBackground(Color.red);
    errorLabel.setForeground(Color.white);
    errorLabel.setOpaque(true);

    reset();
}