JDK-6715419 : Selection in JEditorPane not obvious with some color schemes
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2008-06-17
  • Updated: 2011-04-28
Description
FULL PRODUCT VERSION :
java version "1.6.0_10-beta"
Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
Java HotSpot(TM) Client VM (build 11.0-b12, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.0.6001]

A DESCRIPTION OF THE PROBLEM :
When the background color of an HTML document is set to #0099ff and text is set to white in JEditorPane and text is selected, it is impossible to see what text is currently selected.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the Main class presented and select some text in the frame. Verify the text is selected by pressing a key.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected to be able to tell what text was selected.
ACTUAL -
Only the cursor moves and it is impossible to determine where the selection started from.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;

public class Main {

	public static void main(String[] args) throws Exception {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		JFrame frame = new JFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JEditorPane pane = new JEditorPane("text/html", "<body style=\"background: #0099ff; color: white\">What is selected and what is not?!?</body>");
		frame.getContentPane().add(pane);
		frame.setSize(200, 200);
		frame.setVisible(true);
	}
}
---------- END SOURCE ----------

Comments
EVALUATION I've used #0066bb instead of #0099ff on WinXP.
03-06-2010