Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Dfile.encoding=UTF-8 works, but -Dfile.encoding=GBK table.enterValue(...) reports error #27

Open
jamxval opened this issue Oct 15, 2014 · 0 comments

Comments

@jamxval
Copy link

jamxval commented Oct 15, 2014

Comparing using UTF-8 to GBK, only one of them can work, I'm not sure if or not it is a bug of Fest Swing or Swing itself.

command line to work:
java -Dfile.encoding=UTF-8 -cp ... TestFrame

command line to repeate error (My PC is Windows XP Chinese version, GBK is defaulted code page):
java -Dfile.encoding=GBK -cp ... TestFrame

org.fest.swing.exception.ActionFailedException: Unable to make visible the location of the index '0' by scrolling the point (1,-1) on javax.swing.JTextField[name='Table.editor', text='A2', enabled=true, visible=true, showing=true]
at org.fest.swing.exception.ActionFailedException.actionFailure(ActionFailedException.java:33)

I also tried to test if or not cell not found results in such error, but when the cell value not found, the error message is Unable to find cell matching value 'B2DD':

grid.enterValue(grid.cell("B2DD"), "B2*");

file versions:
fest-asset-1.2.jar
fest-swing-1.2.jar
fest-reflect-1.2.jar
fest-util-1.1.2.jar

JRE (x86 version) :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

Machine:
Windows XP SP3 Chinese language (GBK is default code page).

Sample Code:

    final JFrame frame = new JFrame();
    frame.setTitle("FEST Swing");
    {
        String[][] matrix = new String[][] { { "A1", "A2", "A3" },
                { "B1", "B2", "B3" } };
        String[] headers = new String[] { "A", "B", "C" };
        JTable g = new JTable(matrix, headers);
        g.setName("Grid");

        frame.getContentPane().add(g);
    }
    frame.setBounds(100, 100, 500, 300);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    FrameFixture target = new FrameFixture(frame);
    target.show();
    JTableFixture grid = target.table("Grid");

    grid.enterValue(grid.cell("A2"), "A2*"); // error reported here.
    grid.enterValue(grid.cell("B2"), "B2*");
@jamxval jamxval changed the title when file.encoding parameter is not UTF-8, error reported -Dfile.encoding=UTF-8 works, but -Dfile.encoding=GBK table.enterValue(...) reports error Oct 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant