Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Rsyntax text area bug. #133

Closed
gabriel-laddel opened this Issue · 6 comments

3 participants

@daveray
Owner

That's fun. Wrapping it in (scrollable (text-area ...)) works around it. My guess is it's a RSyntax bug. I'll see if I can reproduce it in Java to be sure.

@daveray
Owner

Yep. This is an RSyntax bug. Here's a vey simple, pure Java example that reproduces it. Maybe report a bug to fifesoft?

package seesaw133;

import java.awt.BorderLayout;

import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;

public class Seesaw133 {

    public static void run() {
        final JPanel bp = new JPanel(new BorderLayout());
        final JPanel vp = new JPanel();
        vp.setLayout(new BoxLayout(vp, BoxLayout.Y_AXIS));

        vp.add(new JLabel("This is a label"));
        vp.add(new RSyntaxTextArea());

        bp.add(vp, BorderLayout.CENTER);
        final JFrame f = new JFrame("Seesaw133");
        f.setContentPane(bp);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                Seesaw133.run();
            }
        });
    }
}
@daveray
Owner

Thanks.

@gabriel-laddel

For anyone who runs into this same issue, you can use a border-panel in place of the vertical-panel as a workaround.

@bobbylight

Hi, I'm the maintainer of RSyntaxTextArea.

Just an FYI that this is not a bug, but rather a case of funky behavior with BoxLayout. The same behavior can be seen in your sample if you replace RSyntaxTextArea entirely with JTextArea.

I suggest putting the JLabel in a JPanel with BorderLayout, at BorderLayout.LINE_START, to force left-aligning of the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.