Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Doesn't run applets

843810Jan 20 2004 — edited Jan 20 2004
Hi, I want to know please, why applets doesn't run in my PDA (Pocket PC)?.....

No support for JDK 1.4 applets found!

Comments

843804
well, of course
843804
Hi hpsmartyz

I couldnt get that response
Can you send me some example code

Regards
Sharmila
camickr
import java.awt.*;
import java.beans.*;
import java.awt.event.*;
import javax.swing.*;

public class SplitPaneResizing extends JFrame implements PropertyChangeListener
{
	JSplitPane left;
	JSplitPane right;

	public SplitPaneResizing()
	{
		JSplitPane main = new JSplitPane();
		getContentPane().add( main );
		left = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
		right = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
		main.setLeftComponent( left );
		main.setRightComponent( right );
//
		left.setTopComponent( createPanel(Color.RED) );
		left.setBottomComponent( createPanel(Color.GREEN) );
		right.setTopComponent( createPanel(Color.BLUE) );
		right.setBottomComponent( createPanel(Color.WHITE) );
//
		left.addPropertyChangeListener( this );
		right.addPropertyChangeListener( this );
	}

	private JPanel createPanel(Color background)
	{
		JPanel panel = new JPanel();
		panel.setPreferredSize( new Dimension(200, 100) );
		panel.setBackground( background );
		return panel;
	}

	public void propertyChange(PropertyChangeEvent e)
	{
		if ("dividerLocation".equals(e.getPropertyName()))
		{
			Object source = e.getSource();
			JSplitPane target = (source.equals(left)) ? right : left;
			int location = ((Integer)e.getNewValue()).intValue();

			if (location != target.getDividerLocation())
				target.setDividerLocation( location );
		}
	}

	public static void main(String[] args)
	{
		SplitPaneResizing frame = new SplitPaneResizing();
		frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
		frame.pack();
		frame.setLocationRelativeTo( null );
		frame.setVisible(true);
	}
}
843804
Hi Camickr

That was great help.
But can u help me in avoiding teat flickering that happens when I drag the horizontal divider ,which I havent observed while dragging the vertical divider.

Thank In Advance
Sharmila

camickr
I don't see any flicker with my example.

I have no idea what kind of components you have on your panels (I'm not a mind reader) so the only suggestion is to use the following method on your left/right splitPanes.:

setContinuousLayout(false);


843804
Hi Camickr

Sorry , If I have explained the issue in another sense.
In SplitPaneResizing.java,we have explicitly made the dividers of the two SpliPanes (left and right) to map each other with respect to any change of the the other.

Due to this explict mapping we can find a little variation between the dividers of left and right dividers

hope you can help me out.

Regards
Sharmila
camickr
Addition to my code in reply 3. If you want continuous update of the divider location then you can use:
left.setContinuousLayout(true);
right.setContinuousLayout(true);
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 17 2004
Added on Jan 20 2004
1 comment
82 views