awt colors




I'm looking for a color navy blue in Awt.

I have seen the colors in AWT.

java.awt.Color;

But I want navy blue.

How would I get it in AWT


Can anyone please help me

Posted On: Wednesday 17th of October 2012 06:41:52 AM Total Views:  83
View Complete with Replies

RELATED TOPICS OF Swing / AWT / SWT PROGRAMMING LANGUAGE




from list awt to JList swing

hi i have create program in awt...now i want create in swing...i have one problem i have this code in awt: int selectedIndex = getCurrentSelectedIndex2(); if(selectedIndex >= 0){ playerCTL.stop(); String selectedSong = getPlayList2().getItem(selectedIndex); SongVO sv= (SongVO)songMap.get(selectedSong);
VIEWS ON THIS POST

176

Posted on:

Thursday 20th September 2012
View Replies!

Trouble with JEditorPane changing colors with styles

I'm using Styles to change the color of my reserved words, but its changing incorrectly, its changing right when I type in the first line but in the next lines only part of the word is changed, what is wrong with my code\t the problem! Uploaded with ImageShack.us this is the code -> public void doFindText(String find) { SimpleAttributeSet bluAttr = new SimpleAttributeSet(); StyleConstants.setForeground(bluAttr, Color.BLUE); SimpleAttributeSet GreenAttr = new SimpleAttributeSet(); StyleConstants.setForeground(GreenAttr, Color.GREEN); int nextPosn = 0; if (!find.equals(findText) ) // *** new find word findPosn = 0; // *** start from top nextPosn = nextIndex( Ed_Prog.getText(), find, findPosn, false); if ( nextPosn >= 0 ) { //Ed_Prog.setSelectionStart( nextPosn-1 ); // position cursor at word start //Ed_Prog.setSelectionEnd( nextPosn + find.length() ); if(find.equalsIgnoreCase("programa")){ Ed_Prog.getStyledDocument().setCharacterAttributes(nextPosn,nextPosn + find.length()+1, bluAttr, false); }else if(find.equalsIgnoreCase("string")){ Ed_Prog.getStyledDocument().setCharacterAttributes(nextPosn-1,nextPosn + find.length()+1, GreenAttr, false); } else if(find.equalsIgnoreCase("inteiro")){ Ed_Prog.getStyledDocument().setCharacterAttributes(nextPosn-1,nextPosn + find.length()+1, GreenAttr, false); } else if(find.equalsIgnoreCase("real")){ Ed_Prog.getStyledDocument().setCharacterAttributes(nextPosn-1,nextPosn + find.length()+1, GreenAttr, false); } findPosn = nextPosn + find.length()+1; // reset for next //search findText = find; // save word & case nextPosn = 0; } else { findPosn = nextPosn; // set to -1 if not found //JOptionPane.showMessageDialog(this, find + " not Found!" ); } }
VIEWS ON THIS POST

206

Posted on:

Saturday 22nd September 2012
View Replies!

getScreenSize() method giving java.awt.HeadlessException

I am getting HeadlessException for getScreenSize() method.Please find the below sample code for more details. Dimension dim = null; try{ dim = Toolkit.getDefaultToolkit().getScreenSize(); }catch(Exception e){ e.printStackTrace(); } The getScreenSize() method is not working in Java 1.6.But it is working in 1.4. Recently we have upgraded the java to 1.6. Can you please help me on this issue |
VIEWS ON THIS POST

220

Posted on:

Tuesday 25th September 2012
View Replies!

java.awt.Robot

can anyone please suggest me with any source from where i can learn about Robot class in detail
VIEWS ON THIS POST

78

Posted on:

Friday 28th September 2012
View Replies!

java.awt.Graphics and java.awt.Graphics2D

Out of simple curiosity who implements the actual methods that draw Since the draw(Shape S) from the java.awt.Graphics2D is an abstract method and I heven't been able to find something that implements logic to it. I got curious!
VIEWS ON THIS POST

83

Posted on:

Saturday 29th September 2012
View Replies!

Problem relating existence of awt pacakage

Iam using jdk1.6. I compiled a code which has "import javax.awt.*;" line, but the problem is compiler says pacakage javax.awt does not exist. What can I do to resolve the problem.
VIEWS ON THIS POST

57

Posted on:

Saturday 29th September 2012
View Replies!

swing & awt: drawing based on pixels?

Hi all: This is a simplified question about some gui details in Java. The background design pattern is mvc. Assume that I need to draw a circle: public class MyCircle { // Please look at the data members private MyPoint center; // MyPoint is just a simple class representing a 2-D point (x,y) private int radius; private String color; // everything below are public methods that set/get values etc ... ... }
VIEWS ON THIS POST

75

Posted on:

Wednesday 17th October 2012
View Replies!

awt vs swings

why do we say that swings are light weight in nature and why was the swings introduced in java in spite of we had the awt.
VIEWS ON THIS POST

91

Posted on:

Wednesday 17th October 2012
View Replies!