Strings with German characters will not compile on Merlin-beta build 49
The test case (below) compiles fine with 1.2 and 1.3, but not with 1.4.
(It also compiles fine with Ladybird build 14.)
echawkes@gradgrind:/home/echawkes/tests/4320834( 101 )% /usr/local/java/jdk1.2/solaris/bin/javac *.java
echawkes@gradgrind:/home/echawkes/tests/4320834( 103 )% /usr/local/java/jdk1.4/solsparc/bin/javac *.java
JFrame1.java:28: unclosed string literal
setTitle("???; //<<<<<<<<<< not supported !!!!!!!!!!!
^
JFrame1.java:30: ')' expected
setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE);
^
Test case (taken from 4320834) :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class JFrame1 extends javax.swing.JFrame
{
public JFrame1()
{
super();
setTitle("ä, ö, ü"); //<<<<<<<<<< not supported !!!!!!!!!!!
setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE);
getContentPane().setLayout(new BorderLayout(0,0));
setSize(488,309);
setVisible(false);
JButton1.setText("k");
getContentPane().add(JButton1);
JButton1.setFont(new Font("Dialog", Font.PLAIN, 12));
JButton1.setBounds(0,0,488,309);
SymWindow aSymWindow = new SymWindow();
this.addWindowListener(aSymWindow);
}
static public void main(String args[])
{
try {
(new JFrame1()).setVisible(true);
}
catch (Throwable t) {
t.printStackTrace();
//Ensure the application exits with an error condition.
System.exit(1);
}
}
public void addNotify()
{
// Record the size of the window prior to calling parents
addNotify.
Dimension size = getSize();
super.addNotify();
if (frameSizeAdjusted)
return;
frameSizeAdjusted = true;
// Adjust size of frame according to the insets and menu bar
javax.swing.JMenuBar menuBar = getRootPane().getJMenuBar();
int menuBarHeight = 0;
if (menuBar != null)
menuBarHeight = menuBar.getPreferredSize().height;
Insets insets = getInsets();
setSize(insets.left + insets.right + size.width, insets.top +
insets.bottom + size.height + menuBarHeight);
}
// Used by addNotify
boolean frameSizeAdjusted = false;
javax.swing.JButton JButton1 = new javax.swing.JButton();
void exitApplication()
{
try {
// Beep
Toolkit.getDefaultToolkit().beep();
// Show a confirmation dialog
int reply = JOptionPane.showConfirmDialog(this,
"Do you really want to
exit?",
"JFC Application -
Exit" ,
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
// If the confirmation was affirmative, handle exiting.
if (reply == JOptionPane.YES_OPTION)
{
this.setVisible(false); // hide the Frame
this.dispose(); // free the system resources
System.exit(0); // close the application
}
} catch (Exception e) {
}
}
class SymWindow extends java.awt.event.WindowAdapter
{
public void windowClosing(java.awt.event.WindowEvent event)
{
Object object = event.getSource();
if (object == JFrame1.this)
JFrame1_windowClosing(event);
}
}
void JFrame1_windowClosing(java.awt.event.WindowEvent event)
{
// to do: code goes here.
JFrame1_windowClosing_Interaction1(event);
}
void JFrame1_windowClosing_Interaction1(java.awt.event.WindowEvent
event) {
try {
this.exitApplication();
} catch (Exception e) {
}
}
}
The test case (below) compiles fine with 1.2 and 1.3, but not with 1.4.
(It also compiles fine with Ladybird build 14.)
echawkes@gradgrind:/home/echawkes/tests/4320834( 101 )% /usr/local/java/jdk1.2/solaris/bin/javac *.java
echawkes@gradgrind:/home/echawkes/tests/4320834( 103 )% /usr/local/java/jdk1.4/solsparc/bin/javac *.java
JFrame1.java:28: unclosed string literal
setTitle("???; //<<<<<<<<<< not supported !!!!!!!!!!!
^
JFrame1.java:30: ')' expected
setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE);
^
Test case (taken from 4320834) :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class JFrame1 extends javax.swing.JFrame
{
public JFrame1()
{
super();
setTitle("ä, ö, ü"); //<<<<<<<<<< not supported !!!!!!!!!!!
setDefaultCloseOperation(javax.swing.JFrame.DO_NOTHING_ON_CLOSE);
getContentPane().setLayout(new BorderLayout(0,0));
setSize(488,309);
setVisible(false);
JButton1.setText("k");
getContentPane().add(JButton1);
JButton1.setFont(new Font("Dialog", Font.PLAIN, 12));
JButton1.setBounds(0,0,488,309);
SymWindow aSymWindow = new SymWindow();
this.addWindowListener(aSymWindow);
}
static public void main(String args[])
{
try {
(new JFrame1()).setVisible(true);
}
catch (Throwable t) {
t.printStackTrace();
//Ensure the application exits with an error condition.
System.exit(1);
}
}
public void addNotify()
{
// Record the size of the window prior to calling parents
addNotify.
Dimension size = getSize();
super.addNotify();
if (frameSizeAdjusted)
return;
frameSizeAdjusted = true;
// Adjust size of frame according to the insets and menu bar
javax.swing.JMenuBar menuBar = getRootPane().getJMenuBar();
int menuBarHeight = 0;
if (menuBar != null)
menuBarHeight = menuBar.getPreferredSize().height;
Insets insets = getInsets();
setSize(insets.left + insets.right + size.width, insets.top +
insets.bottom + size.height + menuBarHeight);
}
// Used by addNotify
boolean frameSizeAdjusted = false;
javax.swing.JButton JButton1 = new javax.swing.JButton();
void exitApplication()
{
try {
// Beep
Toolkit.getDefaultToolkit().beep();
// Show a confirmation dialog
int reply = JOptionPane.showConfirmDialog(this,
"Do you really want to
exit?",
"JFC Application -
Exit" ,
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
// If the confirmation was affirmative, handle exiting.
if (reply == JOptionPane.YES_OPTION)
{
this.setVisible(false); // hide the Frame
this.dispose(); // free the system resources
System.exit(0); // close the application
}
} catch (Exception e) {
}
}
class SymWindow extends java.awt.event.WindowAdapter
{
public void windowClosing(java.awt.event.WindowEvent event)
{
Object object = event.getSource();
if (object == JFrame1.this)
JFrame1_windowClosing(event);
}
}
void JFrame1_windowClosing(java.awt.event.WindowEvent event)
{
// to do: code goes here.
JFrame1_windowClosing_Interaction1(event);
}
void JFrame1_windowClosing_Interaction1(java.awt.event.WindowEvent
event) {
try {
this.exitApplication();
} catch (Exception e) {
}
}
}
- duplicates
-
JDK-4457851 (cs) JCK13a api/java_io/CharacterEncoding/primarySBCS.html#ISO_8859_1 Solaris sp
- Closed