Convert a string into a colour: HELP please

I have a JComboBox which gives a Color selection (String) and i want to convert the selected string into a color so that i can call:
Private void setColor(Color color)
colorname = color;
repaint();
}any ideas?

I have a class similar to the one shown in the previous post. Not wishing to be redundant, I am listing the class only to show other color constants that could be used in your application.
I also am inclined to suggest using the JColorChooser widget.
public class NamedColor
public static final NamedColor[] HTML_COLORS = {
new NamedColor("Snow", new Color(255, 250, 250)) //#FFFAFA
, new NamedColor("GhostWhite", new Color(248, 248, 255)) //#F8F8FF
, new NamedColor("WhiteSmoke", new Color(245, 245, 245)) //#F5F5F5
, new NamedColor("Gainsboro", new Color(220, 220, 220)) //#DCDCDC
, new NamedColor("FloralWhite", new Color(255, 250, 240)) //#FFFAF0
, new NamedColor("OldLace", new Color(253, 245, 230)) //#FDF5E6
, new NamedColor("Linen", new Color(250, 240, 230)) //#FAF0E6
, new NamedColor("AntiqueWhite", new Color(250, 235, 215)) //#FAEBD7
, new NamedColor("PapayaWhip", new Color(255, 239, 213)) //#FFEFD5
, new NamedColor("BlanchedAlmond", new Color(255, 235, 205)) //#FFEBCD
, new NamedColor("Bisque", new Color(255, 228, 196)) //#FFE4C4
, new NamedColor("PeachPuff", new Color(255, 218, 185)) //#FFDAB9
, new NamedColor("NavajoWhite", new Color(255, 222, 173)) //#FFDEAD
, new NamedColor("Moccasin", new Color(255, 228, 181)) //#FFE4B5
, new NamedColor("Cornsilk", new Color(255, 248, 220)) //#FFF8DC
, new NamedColor("Ivory", new Color(255, 255, 240)) //#FFFFF0
, new NamedColor("LemonChiffon", new Color(255, 250, 205)) //#FFFACD
, new NamedColor("Seashell", new Color(255, 245, 238)) //#FFF5EE
, new NamedColor("Honeydew", new Color(240, 255, 240)) //#F0FFF0
, new NamedColor("MintCream", new Color(245, 255, 250)) //#F5FFFA
, new NamedColor("Azure", new Color(240, 255, 255)) //#F0FFFF
, new NamedColor("AliceBlue", new Color(240, 248, 255)) //#F0F8FF
, new NamedColor("lavender", new Color(230, 230, 250)) //#E6E6FA
, new NamedColor("LavenderBlush", new Color(255, 240, 245)) //#FFF0F5
, new NamedColor("MistyRose", new Color(255, 228, 225)) //#FFE4E1
, new NamedColor("White", new Color(255, 255, 255)) //#FFFFFF
, new NamedColor("Black", new Color(0, 0, 0)) //#000000
, new NamedColor("DarkSlateGray", new Color(47, 79, 79)) //#2F4F4F
, new NamedColor("DimGrey", new Color(105, 105, 105)) //#696969
, new NamedColor("SlateGrey", new Color(112, 128, 144)) //#708090
, new NamedColor("LightSlateGray", new Color(119, 136, 153)) //#778899
, new NamedColor("Grey", new Color(190, 190, 190)) //#BEBEBE
, new NamedColor("LightGray", new Color(211, 211, 211)) //#D3D3D3
, new NamedColor("MidnightBlue", new Color(25, 25, 112)) //#191970
, new NamedColor("NavyBlue", new Color(0, 0, 128)) //#000080
, new NamedColor("CornflowerBlue", new Color(100, 149, 237)) //#6495ED
, new NamedColor("DarkSlateBlue", new Color(72, 61, 139)) //#483D8B
, new NamedColor("SlateBlue", new Color(106, 90, 205)) //#6A5ACD
, new NamedColor("MediumSlateBlue", new Color(123, 104, 238)) //#7B68EE
, new NamedColor("LightSlateBlue", new Color(132, 112, 255)) //#8470FF
, new NamedColor("MediumBlue", new Color(0, 0, 205)) //#0000CD
, new NamedColor("RoyalBlue", new Color(65, 105, 225)) //#4169E1
, new NamedColor("Blue", new Color(0, 0, 255)) //#0000FF
, new NamedColor("DodgerBlue", new Color(30, 144, 255)) //#1E90FF
, new NamedColor("DeepSkyBlue", new Color(0, 191, 255)) //#00BFFF
, new NamedColor("SkyBlue", new Color(135, 206, 235)) //#87CEEB
, new NamedColor("LightSkyBlue", new Color(135, 206, 250)) //#87CEFA
, new NamedColor("SteelBlue", new Color(70, 130, 180)) //#4682B4
, new NamedColor("LightSteelBlue", new Color(176, 196, 222)) //#B0C4DE
, new NamedColor("LightBlue", new Color(173, 216, 230)) //#ADD8E6
, new NamedColor("PowderBlue", new Color(176, 224, 230)) //#B0E0E6
, new NamedColor("PaleTurquoise", new Color(175, 238, 238)) //#AFEEEE
, new NamedColor("DarkTurquoise", new Color(0, 206, 209)) //#00CED1
, new NamedColor("MediumTurquoise", new Color(72, 209, 204)) //#48D1CC
, new NamedColor("Turquoise", new Color(64, 224, 208)) //#40E0D0
, new NamedColor("Cyan", new Color(0, 255, 255)) //#00FFFF
, new NamedColor("LightCyan", new Color(224, 255, 255)) //#E0FFFF
, new NamedColor("CadetBlue", new Color(95, 158, 160)) //#5F9EA0
, new NamedColor("MediumAquamarine", new Color(102, 205, 170)) //#66CDAA
, new NamedColor("Aquamarine", new Color(127, 255, 212)) //#7FFFD4
, new NamedColor("DarkGreen", new Color(0, 100, 0)) //#006400
, new NamedColor("DarkOliveGreen", new Color(85, 107, 47)) //#556B2F
, new NamedColor("DarkSeaGreen", new Color(143, 188, 143)) //#8FBC8F
, new NamedColor("SeaGreen", new Color(46, 139, 87)) //#2E8B57
, new NamedColor("MediumSeaGreen", new Color(60, 179, 113)) //#3CB371
, new NamedColor("LightSeaGreen", new Color(32, 178, 170)) //#20B2AA
, new NamedColor("PaleGreen", new Color(152, 251, 152)) //#98FB98
, new NamedColor("SpringGreen", new Color(0, 255, 127)) //#00FF7F
, new NamedColor("LawnGreen", new Color(124, 252, 0)) //#7CFC00
, new NamedColor("Green", new Color(0, 255, 0)) //#00FF00
, new NamedColor("Chartreuse", new Color(127, 255, 0)) //#7FFF00
, new NamedColor("MedSpringGreen", new Color(0, 250, 154)) //#00FA9A
, new NamedColor("GreenYellow", new Color(173, 255, 47)) //#ADFF2F
, new NamedColor("LimeGreen", new Color(50, 205, 50)) //#32CD32
, new NamedColor("YellowGreen", new Color(154, 205, 50)) //#9ACD32
, new NamedColor("ForestGreen", new Color(34, 139, 34)) //#228B22
, new NamedColor("OliveDrab", new Color(107, 142, 35)) //#6B8E23
, new NamedColor("DarkKhaki", new Color(189, 183, 107)) //#BDB76B
, new NamedColor("PaleGoldenrod", new Color(238, 232, 170)) //#EEE8AA
, new NamedColor("LtGoldenrodYello", new Color(250, 250, 210)) //#FAFAD2
, new NamedColor("LightYellow", new Color(255, 255, 224)) //#FFFFE0
, new NamedColor("Yellow", new Color(255, 255, 0)) //#FFFF00
, new NamedColor("Gold", new Color(255, 215, 0)) //#FFD700
, new NamedColor("LightGoldenrod", new Color(238, 221, 130)) //#EEDD82
, new NamedColor("goldenrod", new Color(218, 165, 32)) //#DAA520
, new NamedColor("DarkGoldenrod", new Color(184, 134, 11)) //#B8860B
, new NamedColor("RosyBrown", new Color(188, 143, 143)) //#BC8F8F
, new NamedColor("IndianRed", new Color(205, 92, 92)) //#CD5C5C
, new NamedColor("SaddleBrown", new Color(139, 69, 19)) //#8B4513
, new NamedColor("Sienna", new Color(160, 82, 45)) //#A0522D
, new NamedColor("Peru", new Color(205, 133, 63)) //#CD853F
, new NamedColor("Burlywood", new Color(222, 184, 135)) //#DEB887
, new NamedColor("Beige", new Color(245, 245, 220)) //#F5F5DC
, new NamedColor("Wheat", new Color(245, 222, 179)) //#F5DEB3
, new NamedColor("SandyBrown", new Color(244, 164, 96)) //#F4A460
, new NamedColor("Tan", new Color(210, 180, 140)) //#D2B48C
, new NamedColor("Chocolate", new Color(210, 105, 30)) //#D2691E
, new NamedColor("Firebrick", new Color(178, 34, 34)) //#B22222
, new NamedColor("Brown", new Color(165, 42, 42)) //#A52A2A
, new NamedColor("DarkSalmon", new Color(233, 150, 122)) //#E9967A
, new NamedColor("Salmon", new Color(250, 128, 114)) //#FA8072
, new NamedColor("LightSalmon", new Color(255, 160, 122)) //#FFA07A
, new NamedColor("Orange", new Color(255, 165, 0)) //#FFA500
, new NamedColor("DarkOrange", new Color(255, 140, 0)) //#FF8C00
, new NamedColor("Coral", new Color(255, 127, 80)) //#FF7F50
, new NamedColor("LightCoral", new Color(240, 128, 128)) //#F08080
, new NamedColor("Tomato", new Color(255, 99, 71)) //#FF6347
, new NamedColor("OrangeRed", new Color(255, 69, 0)) //#FF4500
, new NamedColor("Red", new Color(255, 0, 0)) //#FF0000
, new NamedColor("HotPink", new Color(255, 105, 180)) //#FF69B4
, new NamedColor("DeepPink", new Color(255, 20, 147)) //#FF1493
, new NamedColor("Pink", new Color(255, 192, 203)) //#FFC0CB
, new NamedColor("LightPink", new Color(255, 182, 193)) //#FFB6C1
, new NamedColor("PaleVioletRed", new Color(219, 112, 147)) //#DB7093
, new NamedColor("Maroon", new Color(176, 48, 96)) //#B03060
, new NamedColor("MediumVioletRed", new Color(199, 21, 133)) //#C71585
, new NamedColor("VioletRed", new Color(208, 32, 144)) //#D02090
, new NamedColor("Magenta", new Color(255, 0, 255)) //#FF00FF
, new NamedColor("Violet", new Color(238, 130, 238)) //#EE82EE
, new NamedColor("Plum", new Color(221, 160, 221)) //#DDA0DD
, new NamedColor("Orchid", new Color(218, 112, 214)) //#DA70D6
, new NamedColor("MediumOrchid", new Color(186, 85, 211)) //#BA55D3
, new NamedColor("DarkOrchid", new Color(153, 50, 204)) //#9932CC
, new NamedColor("DarkViolet", new Color(148, 0, 211)) //#9400D3
, new NamedColor("BlueViolet", new Color(138, 43, 226)) //#8A2BE2
, new NamedColor("Purple", new Color(160, 32, 240)) //#A020F0
, new NamedColor("MediumPurple", new Color(147, 112, 219)) //#9370DB
, new NamedColor("Thistle", new Color(216, 191, 216)) //#D8BFD8
, new NamedColor("Snow1", new Color(255, 250, 250)) //#FFFAFA
, new NamedColor("Snow2", new Color(238, 233, 233)) //#EEE9E9
, new NamedColor("Snow3", new Color(205, 201, 201)) //#CDC9C9
, new NamedColor("Snow4", new Color(139, 137, 137)) //#8B8989
, new NamedColor("Seashell1", new Color(255, 245, 238)) //#FFF5EE
, new NamedColor("Seashell2", new Color(238, 229, 222)) //#EEE5DE
, new NamedColor("Seashell3", new Color(205, 197, 191)) //#CDC5BF
, new NamedColor("Seashell4", new Color(139, 134, 130)) //#8B8682
, new NamedColor("AntiqueWhite1", new Color(255, 239, 219)) //#FFEFDB
, new NamedColor("AntiqueWhite2", new Color(238, 223, 204)) //#EEDFCC
, new NamedColor("AntiqueWhite3", new Color(205, 192, 176)) //#CDC0B0
, new NamedColor("AntiqueWhite4", new Color(139, 131, 120)) //#8B8378
, new NamedColor("Bisque1", new Color(255, 228, 196)) //#FFE4C4
, new NamedColor("Bisque2", new Color(238, 213, 183)) //#EED5B7
, new NamedColor("Bisque3", new Color(205, 183, 158)) //#CDB79E
, new NamedColor("Bisque4", new Color(139, 125, 107)) //#8B7D6B
, new NamedColor("PeachPuff1", new Color(255, 218, 185)) //#FFDAB9
, new NamedColor("PeachPuff2", new Color(238, 203, 173)) //#EECBAD
, new NamedColor("PeachPuff3", new Color(205, 175, 149)) //#CDAF95
, new NamedColor("PeachPuff4", new Color(139, 119, 101)) //#8B7765
, new NamedColor("NavajoWhite1", new Color(255, 222, 173)) //#FFDEAD
, new NamedColor("NavajoWhite2", new Color(238, 207, 161)) //#EECFA1
, new NamedColor("NavajoWhite3", new Color(205, 179, 139)) //#CDB38B
, new NamedColor("NavajoWhite4", new Color(139, 121, 94)) //#8B795E
, new NamedColor("LemonChiffon1", new Color(255, 250, 205)) //#FFFACD
, new NamedColor("LemonChiffon2", new Color(238, 233, 191)) //#EEE9BF
, new NamedColor("LemonChiffon3", new Color(205, 201, 165)) //#CDC9A5
, new NamedColor("LemonChiffon4", new Color(139, 137, 112)) //#8B8970
, new NamedColor("Cornsilk1", new Color(255, 248, 220)) //#FFF8DC
, new NamedColor("Cornsilk2", new Color(238, 232, 205)) //#EEE8CD
, new NamedColor("Cornsilk3", new Color(205, 200, 177)) //#CDC8B1
, new NamedColor("Cornsilk4", new Color(139, 136, 120)) //#8B8878
, new NamedColor("Ivory1", new Color(255, 255, 240)) //#FFFFF0
, new NamedColor("Ivory2", new Color(238, 238, 224)) //#EEEEE0
, new NamedColor("Ivory3", new Color(205, 205, 193)) //#CDCDC1
, new NamedColor("Ivory4", new Color(139, 139, 131)) //#8B8B83
, new NamedColor("Honeydew1", new Color(240, 255, 240)) //#F0FFF0
, new NamedColor("Honeydew2", new Color(224, 238, 224)) //#E0EEE0
, new NamedColor("Honeydew3", new Color(193, 205, 193)) //#C1CDC1
, new NamedColor("Honeydew4", new Color(131, 139, 131)) //#838B83
, new NamedColor("LavenderBlush1", new Color(255, 240, 245)) //#FFF0F5
, new NamedColor("LavenderBlush2", new Color(238, 224, 229)) //#EEE0E5
, new NamedColor("LavenderBlush3", new Color(205, 193, 197)) //#CDC1C5
, new NamedColor("LavenderBlush4", new Color(139, 131, 134)) //#8B8386
, new NamedColor("MistyRose1", new Color(255, 228, 225)) //#FFE4E1
, new NamedColor("MistyRose2", new Color(238, 213, 210)) //#EED5D2
, new NamedColor("MistyRose3", new Color(205, 183, 181)) //#CDB7B5
, new NamedColor("MistyRose4", new Color(139, 125, 123)) //#8B7D7B
, new NamedColor("Azure1", new Color(240, 255, 255)) //#F0FFFF
, new NamedColor("Azure2", new Color(224, 238, 238)) //#E0EEEE
, new NamedColor("Azure3", new Color(193, 205, 205)) //#C1CDCD
, new NamedColor("Azure4", new Color(131, 139, 139)) //#838B8B
, new NamedColor("SlateBlue1", new Color(131, 111, 255)) //#836FFF
, new NamedColor("SlateBlue2", new Color(122, 103, 238)) //#7A67EE
, new NamedColor("SlateBlue3", new Color(105, 89, 205)) //#6959CD
, new NamedColor("SlateBlue4", new Color(71, 60, 139)) //#473C8B
, new NamedColor("RoyalBlue1", new Color(72, 118, 255)) //#4876FF
, new NamedColor("RoyalBlue2", new Color(67, 110, 238)) //#436EEE
, new NamedColor("RoyalBlue3", new Color(58, 95, 205)) //#3A5FCD
, new NamedColor("RoyalBlue4", new Color(39, 64, 139)) //#27408B
, new NamedColor("Blue1", new Color(0, 0, 255)) //#0000FF
, new NamedColor("Blue2", new Color(0, 0, 238)) //#0000EE
, new NamedColor("Blue3", new Color(0, 0, 205)) //#0000CD
, new NamedColor("Blue4", new Color(0, 0, 139)) //#00008B
, new NamedColor("DodgerBlue1", new Color(30, 144, 255)) //#1E90FF
, new NamedColor("DodgerBlue2", new Color(28, 134, 238)) //#1C86EE
, new NamedColor("DodgerBlue3", new Color(24, 116, 205)) //#1874CD
, new NamedColor("DodgerBlue4", new Color(16, 78, 139)) //#104E8B
, new NamedColor("SteelBlue1", new Color(99, 184, 255)) //#63B8FF
, new NamedColor("SteelBlue2", new Color(92, 172, 238)) //#5CACEE
, new NamedColor("SteelBlue3", new Color(79, 148, 205)) //#4F94CD
, new NamedColor("SteelBlue4", new Color(54, 100, 139)) //#36648B
, new NamedColor("DeepSkyBlue1", new Color(0, 191, 255)) //#00BFFF
, new NamedColor("DeepSkyBlue2", new Color(0, 178, 238)) //#00B2EE
, new NamedColor("DeepSkyBlue3", new Color(0, 154, 205)) //#009ACD
, new NamedColor("DeepSkyBlue4", new Color(0, 104, 139)) //#00688B
, new NamedColor("SkyBlue1", new Color(135, 206, 255)) //#87CEFF
, new NamedColor("SkyBlue2", new Color(126, 192, 238)) //#7EC0EE
, new NamedColor("SkyBlue3", new Color(108, 166, 205)) //#6CA6CD
, new NamedColor("SkyBlue4", new Color(74, 112, 139)) //#4A708B
, new NamedColor("LightSkyBlue1", new Color(176, 226, 255)) //#B0E2FF
, new NamedColor("LightSkyBlue2", new Color(164, 211, 238)) //#A4D3EE
, new NamedColor("LightSkyBlue3", new Color(141, 182, 205)) //#8DB6CD
, new NamedColor("LightSkyBlue4", new Color(96, 123, 139)) //#607B8B
, new NamedColor("SlateGray1", new Color(198, 226, 255)) //#C6E2FF
, new NamedColor("SlateGray2", new Color(185, 211, 238)) //#B9D3EE
, new NamedColor("SlateGray3", new Color(159, 182, 205)) //#9FB6CD
, new NamedColor("SlateGray4", new Color(108, 123, 139)) //#6C7B8B
, new NamedColor("LightSteelBlue1", new Color(202, 225, 255)) //#CAE1FF
, new NamedColor("LightSteelBlue2", new Color(188, 210, 238)) //#BCD2EE
, new NamedColor("LightSteelBlue3", new Color(162, 181, 205)) //#A2B5CD
, new NamedColor("LightSteelBlue4", new Color(110, 123, 139)) //#6E7B8B
, new NamedColor("LightBlue1", new Color(191, 239, 255)) //#BFEFFF
, new NamedColor("LightBlue2", new Color(178, 223, 238)) //#B2DFEE
, new NamedColor("LightBlue3", new Color(154, 192, 205)) //#9AC0CD
, new NamedColor("LightBlue4", new Color(104, 131, 139)) //#68838B
, new NamedColor("LightCyan1", new Color(224, 255, 255)) //#E0FFFF
, new NamedColor("LightCyan2", new Color(209, 238, 238)) //#D1EEEE
, new NamedColor("LightCyan3", new Color(180, 205, 205)) //#B4CDCD
, new NamedColor("LightCyan4", new Color(122, 139, 139)) //#7A8B8B
, new NamedColor("PaleTurquoise1", new Color(187, 255, 255)) //#BBFFFF
, new NamedColor("PaleTurquoise2", new Color(174, 238, 238)) //#AEEEEE
, new NamedColor("PaleTurquoise3", new Color(150, 205, 205)) //#96CDCD
, new NamedColor("PaleTurquoise4", new Color(102, 139, 139)) //#668B8B
, new NamedColor("CadetBlue1", new Color(152, 245, 255)) //#98F5FF
, new NamedColor("CadetBlue2", new Color(142, 229, 238)) //#8EE5EE
, new NamedColor("CadetBlue3", new Color(122, 197, 205)) //#7AC5CD
, new NamedColor("CadetBlue4", new Color(83, 134, 139)) //#53868B
, new NamedColor("Turquoise1", new Color(0, 245, 255)) //#00F5FF
, new NamedColor("Turquoise2", new Color(0, 229, 238)) //#00E5EE
, new NamedColor("Turquoise3", new Color(0, 197, 205)) //#00C5CD
, new NamedColor("Turquoise4", new Color(0, 134, 139)) //#00868B
, new NamedColor("Cyan1", new Color(0, 255, 255)) //#00FFFF
, new NamedColor("Cyan2", new Color(0, 238, 238)) //#00EEEE
, new NamedColor("Cyan3", new Color(0, 205, 205)) //#00CDCD
, new NamedColor("Cyan4", new Color(0, 139, 139)) //#008B8B
, new NamedColor("DarkSlateGray1", new Color(151, 255, 255)) //#97FFFF
, new NamedColor("DarkSlateGray2", new Color(141, 238, 238)) //#8DEEEE
, new NamedColor("DarkSlateGray3", new Color(121, 205, 205)) //#79CDCD
, new NamedColor("DarkSlateGray4", new Color(82, 139, 139)) //#528B8B
, new NamedColor("Aquamarine1", new Color(127, 255, 212)) //#7FFFD4
, new NamedColor("Aquamarine2", new Color(118, 238, 198)) //#76EEC6
, new NamedColor("Aquamarine3", new Color(102, 205, 170)) //#66CDAA
, new NamedColor("Aquamarine4", new Color(69, 139, 116)) //#458B74
, new NamedColor("DarkSeaGreen1", new Color(193, 255, 193)) //#C1FFC1
, new NamedColor("DarkSeaGreen2", new Color(180, 238, 180)) //#B4EEB4
, new NamedColor("DarkSeaGreen3", new Color(155, 205, 155)) //#9BCD9B
, new NamedColor("DarkSeaGreen4", new Color(105, 139, 105)) //#698B69
, new NamedColor("SeaGreen1", new Color(84, 255, 159)) //#54FF9F
, new NamedColor("SeaGreen2", new Color(78, 238, 148)) //#4EEE94
, new NamedColor("SeaGreen3", new Color(67, 205, 128)) //#43CD80
, new NamedColor("SeaGreen4", new Color(46, 139, 87)) //#2E8B57
, new NamedColor("PaleGreen1", new Color(154, 255, 154)) //#9AFF9A
, new NamedColor("PaleGreen2", new Color(144, 238, 144)) //#90EE90
, new NamedColor("PaleGreen3", new Color(124, 205, 124)) //#7CCD7C
, new NamedColor("PaleGreen4", new Color(84, 139, 84)) //#548B54
, new NamedColor("SpringGreen1", new Color(0, 255, 127)) //#00FF7F
, new NamedColor("SpringGreen2", new Color(0, 238, 118)) //#00EE76
, new NamedColor("SpringGreen3", new Color(0, 205, 102)) //#00CD66
, new NamedColor("SpringGreen4", new Color(0, 139, 69)) //#008B45
, new NamedColor("Green1", new Color(0, 255, 0)) //#00FF00
, new NamedColor("Green2", new Color(0, 238, 0)) //#00EE00
, new NamedColor("Green3", new Color(0, 205, 0)) //#00CD00
, new NamedColor("Green4", new Color(0, 139, 0)) //#008B00
, new NamedColor("Chartreuse1", new Color(127, 255, 0)) //#7FFF00
, new NamedColor("Chartreuse2", new Color(118, 238, 0)) //#76EE00
, new NamedColor("Chartreuse3", new Color(102, 205, 0)) //#66CD00
, new NamedColor("Chartreuse4", new Color(69, 139, 0)) //#458B00
, new NamedColor("OliveDrab1", new Color(192, 255, 62)) //#C0FF3E
, new NamedColor("OliveDrab2", new Color(179, 238, 58)) //#B3EE3A
, new NamedColor("OliveDrab3", new Color(154, 205, 50)) //#9ACD32
, new NamedColor("OliveDrab4", new Color(105, 139, 34)) //#698B22
, new NamedColor("DarkOliveGreen1", new Color(202, 255, 112)) //#CAFF70
, new NamedColor("DarkOliveGreen2", new Color(188, 238, 104)) //#BCEE68
, new NamedColor("DarkOliveGreen3", new Color(162, 205, 90)) //#A2CD5A
, new NamedColor("DarkOliveGreen4", new Color(110, 139, 61)) //#6E8B3D
, new NamedColor("Khaki1", new Color(255, 246, 143)) //#FFF68F
, new NamedColor("Khaki2", new Color(238, 230, 133)) //#EEE685
, new NamedColor("Khaki3", new Color(205, 198, 115)) //#CDC673
, new NamedColor("Khaki4", new Color(139, 134, 78)) //#8B864E
, new NamedColor("LightGoldenrod1", new Color(255, 236, 139)) //#FFEC8B
, new NamedColor("LightGoldenrod2", new Color(238, 220, 130)) //#EEDC82
, new NamedColor("LightGoldenrod3", new Color(205, 190, 112)) //#CDBE70
, new NamedColor("LightGoldenrod4", new Color(139, 129, 76)) //#8B814C
, new NamedColor("LightYellow1", new Color(255, 255, 224)) //#FFFFE0
, new NamedColor("LightYellow2", new Color(238, 238, 209)) //#EEEED1
, new NamedColor("LightYellow3", new Color(205, 205, 180)) //#CDCDB4
, new NamedColor("LightYellow4", new Color(139, 139, 122)) //#8B8B7A
, new NamedColor("Yellow1", new Color(255, 255, 0)) //#FFFF00
, new NamedColor("Yellow2", new Color(238, 238, 0)) //#EEEE00
, new NamedColor("Yellow3", new Color(205, 205, 0)) //#CDCD00
, new NamedColor("Yellow4", new Color(139, 139, 0)) //#8B8B00
, new NamedColor("Gold1", new Color(255, 215, 0)) //#FFD700
, new NamedColor("Gold2", new Color(238, 201, 0)) //#EEC900
, new NamedColor("Gold3", new Color(205, 173, 0)) //#CDAD00
, new NamedColor("Gold4", new Color(139, 117, 0)) //#8B7500
, new NamedColor("Goldenrod1", new Color(255, 193, 37)) //#FFC125
, new NamedColor("Goldenrod2", new Color(238, 180, 34)) //#EEB422
, new NamedColor("Goldenrod3", new Color(205, 155, 29)) //#CD9B1D
, new NamedColor("Goldenrod4", new Color(139, 105, 20)) //#8B6914
, new NamedColor("DarkGoldenrod1", new Color(255, 185, 15)) //#FFB90F
, new NamedColor("DarkGoldenrod2", new Color(238, 173, 14)) //#EEAD0E
, new NamedColor("DarkGoldenrod3", new Color(205, 149, 12)) //#CD950C
, new NamedColor("DarkGoldenrod4", new Color(139, 101, 8)) //#8B658B
, new NamedColor("RosyBrown1", new Color(255, 193, 193)) //#FFC1C1
, new NamedColor("RosyBrown2", new Color(238, 180, 180)) //#EEB4B4
, new NamedColor("RosyBrown3", new Color(205, 155, 155)) //#CD9B9B
, new NamedColor("RosyBrown4", new Color(139, 105, 105)) //#8B6969
, new NamedColor("IndianRed1", new Color(255, 106, 106)) //#FF6A6A
, new NamedColor("IndianRed2", new Color(238, 99, 99)) //#EE6363
, new NamedColor("IndianRed3", new Color(205, 85, 85)) //#CD5555
, new NamedColor("IndianRed4", new Color(139, 58, 58)) //#8B3A3A
, new NamedColor("Sienna1", new Color(255, 130, 71)) //#FF8247
, new NamedColor("Sienna2", new Color(238, 121, 66)) //#EE7942
, new NamedColor("Sienna3", new Color(205, 104, 57)) //#CD6839
, new NamedColor("Sienna4", new Color(139, 71, 38)) //#8B4726
, new NamedColor("Burlywood1", new Color(255, 211, 155)) //#FFD39B
, new NamedColor("Burlywood2", new Color(238, 197, 145)) //#EEC591
, new NamedColor("Burlywood3", new Color(205, 170, 125)) //#CDAA7D
, new NamedColor("Burlywood4", new Color(139, 115, 85)) //#8B7355
, new NamedColor("Wheat1", new Color(255, 231, 186)) //#FFE7BA
, new NamedColor("Wheat2", new Color(238, 216, 174)) //#EED8AE
, new NamedColor("Wheat3", new Color(205, 186, 150)) //#CDBA96
, new NamedColor("Wheat4", new Color(139, 126, 102)) //#8B7E66
, new NamedColor("Tan1", new Color(255, 165, 79)) //#FFA54F
, new NamedColor("Tan2", new Color(238, 154, 73)) //#EE9A49
, new NamedColor("Tan3", new Color(205, 133, 63)) //#CD853F
, new NamedColor("Tan4", new Color(139, 90, 43)) //#8B5A2B
, new NamedColor("Chocolate1", new Color(255, 127, 36)) //#FF7F24
, new NamedColor("Chocolate2", new Color(238, 118, 33)) //#EE7621
, new NamedColor("Chocolate3", new Color(205, 102, 29)) //#CD661D
, new NamedColor("Chocolate4", new Color(139, 69, 19)) //#8B4513
, new NamedColor("Firebrick1", new Color(255, 48, 48)) //#FF3030
, new NamedColor("Firebrick2", new Color(238, 44, 44)) //#EE2C2C
, new NamedColor("Firebrick3", new Color(205, 38, 38)) //#CD2626
, new NamedColor("Firebrick4", new Color(139, 26, 26)) //#8B1A1A
, new NamedColor("Brown1", new Color(255, 64, 64)) //#FF4040
, new NamedColor("Brown2", new Color(238, 59, 59)) //#EE3B3B
, new NamedColor("Brown3", new Color(205, 51, 51)) //#CD3333
, new NamedColor("Brown4", new Color(139, 35, 35)) //#8B2323
, new NamedColor("Salmon1", new Color(255, 140, 105)) //#FF8C69
, new NamedColor("Salmon2", new Color(238, 130, 98)) //#EE8262
, new NamedColor("Salmon3", new Color(205, 112, 84)) //#CD7054
, new NamedColor("Salmon4", new Color(139, 76, 57)) //#8B4C39
, new NamedColor("LightSalmon1", new Color(255, 160, 122)) //#FFA07A
, new NamedColor("LightSalmon2", new Color(238, 149, 114)) //#EE9572
, new NamedColor("LightSalmon3", new Color(205, 129, 98)) //#CD8162
, new NamedColor("LightSalmon4", new Color(139, 87, 66)) //#8B5742
, new NamedColor("Orange1", new Color(255, 165, 0)) //#FFA500
, new NamedColor("Orange2", new Color(238, 154, 0)) //#EE9A00
, new NamedColor("Orange3", new Color(205, 133, 0)) //#CD8500
, new NamedColor("Orange4", new Color(139, 90, 0)) //#8B5A00
, new NamedColor("DarkOrange1", new Color(255, 127, 0)) //#FF7F00
, new NamedColor("DarkOrange2", new Color(238, 118, 0)) //#EE7600
, new NamedColor("DarkOrange3", new Color(205, 102, 0)) //#CD6600
, new NamedColor("DarkOrange4", new Color(139, 69, 0)) //#8B4500
, new NamedColor("Coral1", new Color(255, 114, 86)) //#FF7256
, new NamedColor("Coral2", new Color(238, 106, 80)) //#EE6A50
, new NamedColor("Coral3", new Color(205, 91, 69)) //#CD5B45
, new NamedColor("Coral4", new Color(139, 62, 47)) //#8B3E2F
, new NamedColor("Tomato1", new Color(255, 99, 71)) //#FF6347
, new NamedColor("Tomato2", new Color(238, 92, 66)) //#EE5C42
, new NamedColor("Tomato3", new Color(205, 79, 57)) //#CD4F39
, new NamedColor("Tomato4", new Color(139, 54, 38)) //#8B3626
, new NamedColor("OrangeRed1", new Color(255, 69, 0)) //#FF4500
, new NamedColor("OrangeRed2", new Color(238, 64, 0)) //#EE4000
, new NamedColor("OrangeRed3", new Color(205, 55, 0)) //#CD3700
, new NamedColor("OrangeRed4", new Color(139, 37, 0)) //#8B2500
, new NamedColor("Red1", new Color(255, 0, 0)) //#FF0000
, new NamedColor("Red2", new Color(238, 0, 0)) //#EE0000
, new NamedColor("Red3", new Color(205, 0, 0)) //#CD0000
, new NamedColor("Red4", new Color(139, 0, 0)) //#8B0000
, new NamedColor("DeepPink1", new Color(255, 20, 147)) //#FF1493
, new NamedColor("DeepPink2", new Color(238, 18, 137)) //#EE1289
, new NamedColor("DeepPink3", new Color(205, 1

Similar Messages

  • XML: How to convert xml string into Node/Document

    I have a string in xml form.
    <name>
    <first/>
    <second/>
    </name>
    I want to convert this string into DOM Node or Document.
    How can I do this?
    Any help or pointer?
    TIA
    Sachin

    Try this :
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(new org.xml.sax.InputSource(new StringReader(strXml)));Hope this helps.

  • Convert XML string into XML

    Hi All,
    Can you please let me know for any sample code in xslt/java mapping for converting XML string into XML. We use SAP Pi 7.0
    My XML string starts like this
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <ns0:MT_ReceiverFileStructure <namespace>"><Output><?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<xsl>"?><Tarih_Date Tarih="11.09.2014" Date="09/11/2014>
       Thanks,
       Pavithra

    Thanks Praveen. It worked.
    However, the xml i have is an extract from a exchange rate URL and it has the reference to a xsl in it as below
    <?xml version="1.0" encoding="ISO-8859-9"?><?xml-stylesheet type="text/xsl" href="<ABC.xsl>"?>.
    So there is an error in sxmb_moni. Is it possible to remove this.

  • Convert XML string into DOM

    Hi all,
    I have a question here regarding converting XML string into a DOM document.
    How can I do this in Java?
    The Document.Parse() methods do not have one that takes in String as its parameter.
    I'm not sure what is the best way to do this in Java.
    Any help is greatly appreciated.
    Thank you in advance.
    regards,
    Sean

    Convert XML String to Document with StringReader.
    String xmlString;
    DocumentBuilderFactory factory =
                DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
       Document         document = builder.parse(new InputSource(new StringReader(xmlString)));

  • How do you convert this String into a double?

    Hi, in this code I want to convert String arg into a double. I'm trying to do this so that I can convert some string into a double in this calculator that I'm making. Here is the code:
    public class par {
    public static void main(String[] args) {
    String str = "351";
    double arg = new double(str); // should convert the string into a double
         System.out.println(arg);
         System.out.println(str);
    I keep getting errors in line 4, if any of you could help me out here I'll be thankful, i'm kinda new to java and my search for java's equivalent of alof() (its a function in C libraries that converts char[] into a double)lead me to this.
    Tony L.

    Use the Following:
    String num = "123.2";
    double d = Double.parseDouble(num);

  • Convert XML string into an abap format date and time

    Hi,
    Does anyone know of a method or a function module in ABAP which converts XML string into an abap format date and time.
    Here is a part of the xml that I want to convert.
    <ns2:EventDateTime>2009-07-02T10:13:45+10:00</ns2:EventDateTime>
    <ns2:EventMessageTransmissionDateTime>2009-07-02T10:13:45.987+10:00</ns2:EventMessageTransmissionDateTime>
    Currently EventDateTime and EventMessageTransmissionDateTime are type XSDDATETIME_Z and these are converted to proper dates and times. We will be changing these fields to a STRING instead of XSDDATETIME_Z. The reason for this is to make the field more versatile. The customer would be receiving dates with Zulu (2009-09-23T12:00:00Z), with offsets (2009-09-23T12:00:00+10:00/-10:00) and just local timestamp (2009-09-23T12:00:00). With this, we need to make the date fields as string
    to be able to accept the various date formats (esp. the local timestamp).
    I am looking for a standard function module or method that will convert the xml string to a proper date and time abap format.
    Would appreciate anyone's help!
    Thanks.
    Edited by: eunice ocson on Jul 13, 2009 1:49 AM
    Edited by: eunice ocson on Jul 13, 2009 1:50 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM
    Edited by: eunice ocson on Jul 13, 2009 1:51 AM

    Hi Eunice
    Use the FM 'SMUM_XML_PARSE'
    for more info
    [Convert XML string to ABAP|XML String to ABAP or GUI]
    hope it helps you.
    Thanks!!

  • How do I convert a string into a decimal

    I've been tryin to convert a string into decimal but I can't get it to work at all. I keep getting an exception.
    I've tried all of these:
    double myDouble = Double.valueOf(string).doubleValue();
    int myint = Interger.parseInt(string);
    float myfloat = Float.parseFloat(string);
    I can't get anything to work.
    That string i'm reading in is an array containing values with decimals. ex: -45.09348
    All the above work fine if there is no decimal, but fails when it comes to one.
    How do I go about doing this?
    Thanks!

    This works for me:String s = "-45.6789";
    double d = Double.parseDouble(s);
    System.out.println(d);Mark

  • How can I convert a string into an image

    I want to convert a string into an image.
    I want to know required steps for that.

    look at http://forum.java.sun.com/thread.jsp?forum=31&thread=194763
    drawString looks as something you might need

  • Converting a string into mySQL date format

    I have a bit of code that collects data values from a bean and I want it to then insert this into a mySQL database. My string is in the format "23/12/1983", how can i put this into a date field in my database? The bit of code I have got so far looks like this...
    String month = formHandler.month + "/";
    String day = formHandler.day + "/";
    String year = formHandler.year ;
    StringBuffer sb = new StringBuffer();
    sb.append(day);
    sb.append(month);
    sb.append(year);
    String myDate = sb.toString();myDate is the value that I want to go into the database

    Limo2kz,
    The key to inserting a date into a database is to convert the date string into an SQL friendly format. i.e. yyyy-MM-dd.
    One way of doing this is as follows:
    SimpleDateFormat NICE_DATE_FORMAT =
    new SimpleDateFormat("dd/MM/yyyy");
    SimpleDateFormat SQL_DATE_FORMAT =
    new SimpleDateFormat("yyyy-MM-dd");
    Date date = new Date();
    try {
    date = NICE_DATE_FORMAT.parse(dateString);
    } catch (ParseException pe) {
    pe.printStackTrace();
    String sqlDate = SQL_DATE_FORMAT.format(date);
    Now it is just a matter of creating the insert statement like normal, and making sure that the date string is in quotes.
    I hope that helps.
    Damian Sutton

  • How can I convert a String into boolean?

    I am facing difficulty in converting String into boolean.
    For example, I have a few variable which i need user to input yes or no as the answer. But I uses string instead. Is there a way which i can ask them to input boolean directly?
    Please advise...
    credit = JOptionPane.showInputDialog("Enter Yes or No for Credit Satisfactory : ");
    System.out.println("The answer for Credit Satisfactory : "+credit);
    e_invtry=JOptionPane.showInputDialog("Enter Yes or No for inventry level");
    System.out.println("The answer for Quantity Order : "+e_invtry);
    Message was edited by:
    SummerCool

    Thanks...but I don't get it....I tried to use your
    suggestion but i got the message that " cannot find
    symbol method
    showConfirmDialog(java.lang.String,int)" ???
    Please advise.
    The code I use was :
    int credit = JOptionPane.showConfirmDialog("Enter Yes
    or No for credit satisfactory",
    JOptionPane.YES_NO_OPTION);Well that was not the example I gave you.
    JOptionPane has no method showConfirmDialog that receives a String and an int (exactly what the error message is telling you).
    What was wrong with the version I showed you?

  • How to convert a string into orcle date format

    i need some information about converting string into date format.i have string like '20-SEP-05' .so we have to convert into date formate like yy-mm-dd' (2005-09-20).how can we do it.

    Here's some code to help. I can't remember what method uses what format though
      public static java.sql.Date sqlDateValueOf( String dateString ) {
        String stringDate = null;
        if ( dateString == null || dateString.length() < 10 ) return null;
        String strDay = "";
        String strMonth = "";
        String strYear = "";
        if ( dateString.substring(4,5).equals( "-" ) ) {
          strDay = dateString.substring(8, 10);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(5, 7);
          strMonth = dateString.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(0, 4);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        else if ( dateString.substring(2,3).equals( "-" ) ) {
          strDay = dateString.substring(0, 2);
          if ( strDay.length() < 2 ) strDay = "0" + strDay;
          strMonth = dateString.substring(3, 5);
          strMonth = String.valueOf(Integer.parseInt(strMonth) - 1);
          if ( strMonth.length() < 2 ) strMonth = "0" + strMonth;
          strYear = dateString.substring(6, 10);
          stringDate = strDay + "-" + strMonth + "-" + strYear;
        Calendar cal = Calendar.getInstance();
        cal.set( Calendar.YEAR, Integer.parseInt( strYear ) );
        cal.set( Calendar.MONTH, Integer.parseInt( strMonth ) );
        cal.set( Calendar.DAY_OF_MONTH, Integer.parseInt( strDay ) );
        java.sql.Date outDate = new java.sql.Date( cal.getTimeInMillis() );
        return outDate;
      public static String toDateString( java.util.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Date date, String format) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat( format );
        outDate = df.format( date );
        return outDate;
      public static String toDateString( java.sql.Timestamp date) {
        if ( date == null || date.toString().length() < 10 ) return null;
        String outDate = "";
        SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy");
        outDate = df.format( date );
        return outDate;
      }

  • How to convert a string into an objects name?

    Hi
    I have the following problem;
    I have a string
    String a = "e1"
    and a method
    call(Event e1) that calls the "Event" class with object the name of the string a.
    How can I convert the strings name into an object so as to use it in the "call" method?
    Any ideas?
    Thanks in advance

    I don't know if this helps you, but you can do things like this.
    String a = "com.example.SomeEvent";
    //Instantiate com.example.SomeEvent
    Object o = Class.forName(a).newInstance();SomeEvent must have a non-argument constructor for this to work.
    Class that will be instantiated depens on runtime value of String a, and can be different across different executions of the program.

  • How to convert a string into a collection of KeyEvents

    I'm working on a program that must interact with a 3rd party application (closed to me, I have no access to the code or anything like that). I have been unable to send data to the program by getting its OutputStream. The only thing that has worked was using a Robot object to send individual key events (i.e. robot.keyPress(KeyEvent.VK_A);). Therefore I'm looking to convert a string (many different strings actually) into a collection of their associated KeyEvents so I can send them to the other application. Does anyone know a good way of doing it, or is anyone able to help me with using the OutputStream?
    Thank you!
    (The 3rd party application is Attachmate InfoConnect, a Unisys terminal emulation program that I have to use to access a mainframe).

    Here is a code sample.     public void checknumber(int vsize){
    int total;
    String anum;
    anum = tf2.getText();
    validnumber = true;
    lines2combine = 1;     //default (an integer)
    recs2make = 1;          //default
    try{
    lines2combine = Integer.parseInt(anum);
    catch (NumberFormatException e){
              System.out.println("Entry for lines to combine not numeric");
         validnumber = false;
         d1Title = "Data Entry Error";
         d1Txt = "For number for lines to combine;";
         d2Txt = "Enter a number.";
         doMessage();

  • I want to convert a String into an array of bytes

    I am working with telnet programming with java, where I want to convert login name and password of an online user in 'String' format to 'Bytes', plz help me. Which Input or Output Stream I can use

    Assuming you've got the username / password into a String object, you can convert it to a byte[] array using this method.
    String.getBytes();
    Look at the String API
    http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html
    Hope that helps.

  • Servlet not inserting into Access Databse. help please

    I have the following code which is inserting three fields into a database. The database name is contacts.mdb, and the table is contacts. I have setup the ODBC connection on the server, of which I have both IIS and Tomcat running. The form.html that I am accessing is on the tomcat server root and that code is below as well. After hitting the submit button on the form I get forwarded to the servlet, and the page is blank. However, when I open the database, no updates have occured. Please help. I hope I have provided enough detail. Thanks so much.
    -------- servlet code start --------------
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class WebServlet
    extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
    IOException {
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String sourceURL = "jdbc:odbc:terry_web_contacts";
    Connection databaseConnection = DriverManager.getConnection(sourceURL);
    Statement stmt = databaseConnection.createStatement();
    String jname = request.getParameter("Name");
    String jemail = request.getParameter("Email");
    String jcomments = request.getParameter("Comments");
    String sqlInsertString ="INSERT INTO contacts (name, email, comments) VALUES ('" + jname +"', '" jemail "', '" + jcomments + "')";
    stmt.executeUpdate(sqlInsertString);
    databaseConnection.close();
    catch(ClassNotFoundException cnfe)
    System.err.println("Error loading Driver");
    catch (SQLException sqle){
    System.err.println("SQL Error");
    ---------- servlet code end ---------------------
    ---------- html form code start ------------------
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY BGCOLOR="WHITE">
    <TABLE BORDER="2" CELLPADDING="2">
    <TR><TD WIDTH="275">
    <H2>I'm a Simple Form</H2>
    <FORM METHOD="POST" ACTION="/servlet/WebServlet">
    <p>
    <INPUT NAME="Name" TYPE="TEXT" id="Name" SIZE=30>
    </p>
    <p>
    <INPUT NAME="Email" TYPE="TEXT" id="Email" SIZE=30>
    </p>
    <p>
    <textarea name="Comments" id="Comments"></textarea>
    </p>
    <P>
    <INPUT TYPE="SUBMIT" VALUE="Click Me">
    <INPUT TYPE="RESET">
    </FORM>
    </TD></TR>
    </TABLE>
    </BODY>
    </HTML>
    ------------- html code end ------------------

    Okay, here is my modified code. However, I catch a sql error. It prints out "sql error". If I try to isolate the different lines of code with try catch blocks, the compiler says it does not recognize the symbols for example stmt, or databaseConnection. Arggh, what can I do? Help please.
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class WebServlet
        extends HttpServlet {
      public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException,IOException
         PrintWriter out = response.getWriter();
         String jname = (String) request.getParameter("Name");
         String jemail = (String) request.getParameter("Email");
         String jcomments = (String) request.getParameter("Comments");
    try
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException e)
         out.println("class error");
    try
         Connection databaseConnection = DriverManager.getConnection("jdbc:odbc:terrycontacts");
         Statement stmt = databaseConnection.createStatement();
         String sqlInsertString ="INSERT INTO contacts(name,email,comments) VALUES('"+jname+"','"+jemail+"','"+jcomments+"')";
         stmt.executeQuery(sqlInsertString);
         databaseConnection.commit();
         databaseConnection.close();
    catch(SQLException e)
         out.println("sql error");
         out.close();
    }

Maybe you are looking for

  • Deleted RAW file after "Open with External Editor"

    I opened a file in PS using the "Open with External Editor" command and saved and it saved the update in Aperture but I needed to make anothe change so I did the same as before using the "Open with External Editor" command. Aperture created another "

  • Does apple store the .mp3 and other files I've purchased 'in the cloud'?

    Does apple store the .mp3 and other files I've purchased 'in the cloud'?  I had to restore my PC and forgot to back them up.  If not, I assume I would potentially need to purchase them again, right?  Please help. THIS IS REGARDING THE iTUNES Client A

  • Zoom ADSL X6 modem router

    My previous ADSL modem failed (Possibly lightening strike)! I had no means to get to this list to find a recommended modem, specifically for iChat which I use every day. I went to my local PC World because it was the only place I knew I would get a c

  • I rent a movi and cannot see it in my iPad what I do?

    I rent a movi (john carter) and cannot see it in my iPad-2 version 5.1.1 what I should do? The message appear is ( the requested URL was not found in this server ). Can anyone help how to solve this problem

  • How to list third-party color profiles

    I just installed the drivers for an Epson 4900. The new profiles don't show up in the color management in the print module. I'm using a Mac with mountain lion. Message title was edited by: Brett N