Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems After shifting swing application from jdk1.3 to 1.4

pavan dv
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have shifted my Swing application from jdk1.3 to 1.4, some component settings changed in j2se1.4. are listed below

1). i have added JComboBox to JPanel using BoxLayout, in jdk1.3 it is normal where as in 1.4 comboBox height is increased to panel height.

Sample code
(in a Panel)
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));

2). in jdk1.3 the icon which is set to JFrame is visible in the JOptioPane.showConfirmationDialog() also, but in 1.4 the icon is not visible in conformation dialog box.

Sample Code
in a JFrame's constructor

public OptionPaneTest()
ImageIcon icon = new ImageIcon("icon.gif");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
JOptionPane.showMessageDialog(this,"hai", "Hai",JOptionPane.WARNING_MESSAGE);


3). the Labels added to the panel or frame are displaying in light blue color with jdk1.3 and the same label displaying in black with j2se1.3

Sample Code

in a JPanel

setLayout(new BorderLayout(20, 20));
add(new JLabel("Testing Label Color"), BorderLayout.CENTER);

please send solution to any or all.

thanks in advance,
Ron Katz
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't realy have an answer for you... sorry
however, my advice to you is to use FormLayout and save yourself troubls with layout.

You can find more about FormLayout in :

The FormLayout source code and documentation are avaialbe for download and free to use and according to my expiriance are alot more friendly, easy to use and give maximal result for minimal effort.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic