class StringPane
{
    private static final String TEXT_TAB = "Text View";
    private static final String HEX_TAB = "Hex view";

    private final JTabbedPane tabbedPane;

    public StringPane(COSString cosString)
    {
        tabbedPane = new JTabbedPane();
        tabbedPane.setPreferredSize(new Dimension(300, 500));
        tabbedPane.addTab(TEXT_TAB, createTextView(cosString));
        tabbedPane.addTab(HEX_TAB, createHexView(cosString));
    }

    private JTextPane createTextView(COSString cosString)
    {
        JTextPane textPane = new JTextPane();
        textPane.setText(getTextString(cosString));
        textPane.setEditable(false);

        return textPane;
    }

    private JComponent createHexView(COSString cosString)
    {
        HexView hexView = new HexView(cosString.getBytes());
        return hexView.getPane();
    }

    private String getTextString(COSString cosString)
    {<FILL_FUNCTION_BODY>}

    public JTabbedPane getPane()
    {
        return tabbedPane;
    }
}

        String text = cosString.getString();
        for (char c : text.toCharArray())
        {
            if (Character.isISOControl(c) && c != '\n' && c != '\r' && c != '\t')
            {
                text = "<" + cosString.toHexString() + ">";
                break;
            }
        }
        return text;
    
<no_super_class>