Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-14-2006, 02:43 AM   PM User | #1
KillaT2005
New to the CF scene

 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
KillaT2005 is an unknown quantity at this point
java help

i need to find a way to make the background of a text box transparent in Java, like so my background image shows through, not a white box
KillaT2005 is offline   Reply With Quote
Old 12-14-2006, 12:15 PM   PM User | #2
martin_narg
Regular Coder

 
martin_narg's Avatar
 
Join Date: Jul 2002
Location: Chamonix, France
Posts: 600
Thanks: 1
Thanked 3 Times in 3 Posts
martin_narg is an unknown quantity at this point
Set the CSS style attribute of the input to "background: none;" as in this example
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Transparent Input</title>
<style type="text/css">
div {
	background: url(http://www.codingforums.com/img/logo.gif) no-repeat;
	width: 315px;
	height: 64px;
}

form input {
	margin-top: 40px;
	background: none; /* this is the important bit */
}
</style>
</head>

<body>
	<form name="frm" method="post" action="#">
		<div>
			<input type="text" name="txt" id="txt" />
		</div>
	</form>
</body>
</html>
Hope this helps.

m_n
__________________
"Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
-Tommy Cooper
martin_narg is offline   Reply With Quote
Old 12-14-2006, 12:19 PM   PM User | #3
KillaT2005
New to the CF scene

 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
KillaT2005 is an unknown quantity at this point
yeah i meant im writing a program in java and need to make a transperant text box
KillaT2005 is offline   Reply With Quote
Old 12-14-2006, 01:14 PM   PM User | #4
martin_narg
Regular Coder

 
martin_narg's Avatar
 
Join Date: Jul 2002
Location: Chamonix, France
Posts: 600
Thanks: 1
Thanked 3 Times in 3 Posts
martin_narg is an unknown quantity at this point
This is a Javascript forum mate, not a Java forum - they are two different languages. You'd be better posting there to get an answer to your question.

m_n
__________________
"Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
-Tommy Cooper
martin_narg is offline   Reply With Quote
Old 12-14-2006, 02:06 PM   PM User | #5
nikkiH
Senior Coder

 
nikkiH's Avatar
 
Join Date: Jun 2005
Location: Near Chicago, IL, USA
Posts: 1,973
Thanks: 1
Thanked 32 Times in 31 Posts
nikkiH is on a distinguished road
Also clarify what kind of textbox. AWT, Swing, etc.
__________________

If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit
http://www.kaelisspace.com/
nikkiH is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:59 PM.


Advertisement
Log in to turn off these ads.