|
Thanks Vilmos....
But can u make the second line a bit more clear.....
ie:
"The default constructor A() simply delegates to the constructor taking an argument A(int x)."
|
|
|
|
|
A constructor can be called just like a function so the line in the default constructor below:
A()
{
this(10);
}
merely calls the constructor that takes an integer parameter and sets the member variable to the value 10. Take a look at The Java Tutorials[^] for more information.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Thanks Richard...
Now its clear.....
|
|
|
|
|
class A
{
int a;
A()
{
this(10);
}
A(int x)
{
a=x;
}
public int somemethod(int value){
return (x*value);
}
Try to make your work easier by giving full classified names to objects, members and methods. and formate the code. make comments - feel free to express you.
regards,
Torsten
I never finish anyth...
|
|
|
|
|
Thanks,Torsten....
Its clear now....
|
|
|
|
|
Hello,
I have the following problem :
- I have a class My frame that extends JFrame and
also I have a class MyComponent that extends JComponent
- the MyComponent class overrides the paint method and displays a picture on a certain position
The problem is that when I call in the MyFrame constructor the methods (inherited from JFrame )
add(new MyComponent( ...position parameters 1.. ))
and also
add(new MyComponent( ...position parameters 2.. ))
only the last one is displayed (if I add more only the last one is drawn).
I spoke to someone and told me that I could be that the frame draws the components on different layers but didn't knew how to solve it ... .I've googled it and still nothing .
If someone had this issue please reply.
Thanks in advance!
|
|
|
|
|
In your overridden paint method, you need to repaint ALL the components not just the alst one added.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
|
Still nothing.
I'ved tried the following:
this are all in the class constructor that extends JFrame
1)
add(new MyComponent(0,0,50,50,12));
add(new MyComponent(100,100,50,50,12));
2)
this.getContentPane().add(new MyComponent(0,0,50,50,12));
this.getContentPane().add(new MyComponent(100,100,50,50,12));
this.repaint();
and only the second component was drawn in both cases. However if I omit comment the second component, the first one is drawn correctly.
My component extends JComponent and overrides paint method by painting a image at the specified coordinates.
|
|
|
|
|
|
Hi:
I am deploying Glassfish 2.1.1 with J2EE 1.4. The project compiles-builds successfully. But it fails to deploy and open in the browser. The error from the log is:
com.sun.enterprise.config.ConfigException: I/O error while loading deployment descriptor for: hello2
caused by
Caused by: java.io.FileNotFoundException: C:/eepassion/UnZip/servletbasics/samples/hello2/build/web
I have looked in the web folder and there is an web folder. But do not know what I'm looking for. Your suggestion would be very helpful.
Lin
|
|
|
|
|
The message seems fairly clear, Java is looking for a file or directory which does not exist, as described in the message. Or possibly there is a permission issue and the program cannot access that folder.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Or possibly there is a permission issue and the program cannot access that folder.
often seen since Windows7 - check if your SDK/involved Programms is marked "run as Admin".
regards
Torsten
I never finish anyth...
|
|
|
|
|
Well I understand that, which is why I suggested it to the OP!
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I am trying to process data by servlet sended by jsp form using AJAX..... with 'GET' method its working okey ... but using 'POST' method to do this creating problem that onreadystatechage condition not exectue at (xmlhttp.readyState==4 && xmlhttp.status==200)
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 || xmlhttp.status==200) {
alert("state=4 OR 200");
document.getElementById("TextChatHistory").value = xmlhttp.responseText;
}
}
i tryed to solve this too much .... but i cant .... Any one plz help me ..... THANK ...
COMPLETE PROGRAM CODE IS GIVEN BELOW,
JSP_CODE
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%--@page import="java.util.Timer.*, java.util.TimerTask.*"
Timer timer;
--%>
<!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=UTF-8">
<title>JSP Page</title>
<script type="text/javascript" >
function AjaxFunction() {
xmlhttp = null;
if(window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 || xmlhttp.status==200) {
alert("state=4 OR 200");
document.getElementById("TextChatHistory").value = xmlhttp.responseText;
}
}
xmlhttp.open("POST", "TextChat", true);
var Parameter_MsgSType = "msgText=" + document.getElementById("msgText").value;
alert(Parameter_MsgSType);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-lenght", Parameter_MsgSType.lenght);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(Parameter_MsgSType);
alert("Ajax fuinction finished");
}
</script>
</head>
<body>
<!--<h1>Hello JSP!</h1>-->
<div id="myText"></div> <!--for testing...-->
<form name="TextChat" method="post" action="" >
<textarea cols="50" rows="10" readonly id="TextChatHistory" name="TextChatHistory" >TextChat History</textarea>
<br />
<textarea cols="50" rows="3" id="msgText" >Enter Text</textarea>
<select name="SentToType">
<option value="p">Presentor</option>
<option value="h">Host</option>
<option value="a">Attendee</option>
<option value="l">All</option>
</select>
<input type="submit" value="SEND" onclick="AjaxFunction()" />
</form>
</body>
</html>
|
|
|
|
|
give me solution of Round robin scheduling code in java
|
|
|
|
|
Ask yourself this: Where would be a good place to search for something that fits my requirements?
This forum tends not to hand out ready made solutions on demand, try doing some research first, and come back here when you have a technical query.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
what is the equivalent package on swing in j2me
Trioum
|
|
|
|
|
J2ME has within it's framework its own set of controls that are desogned for generic mobile devices. If you are targetting a specific platform then you will also find that there are platform specific UI components. Check the JavaDoc for details.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
hi ...
i m trying to make this me first simple AJAX example using PHP that shows message from PHP on clicking Button in HTML page .... but this case some prolem ... that is when click on button to show message then nothing is happen .... is also check WAMP ... so any idea or suggestion !!!!
HTML CODE IS,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MyFirstAJAXProram</title>
</head>
<body>
<script type="text/javascript">
function JavaFunction() {
var xmlhttp;
<!--Getting XMLHttpRequest OR Active depends on browser support...-->
if(window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if(xmlhttp.readystate == 4) {
document.timerForm.time.value = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "phpfile.php", true);
xmlhttp.send(null);
}
</script>
<form name="timerForm">
<input type="button" onclick="JavaFunction()"; />
Time: <input type="text" id="timer" name="time" value="00:00:00" readonly="readonly" />
</form>
</body>
</html>
HERE's PHP CODE,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
echo("KHURRAM SHAHZAD");
?>
</body>
</html>
|
|
|
|
|
khurram_shahzad wrote: so any idea or suggestion
Since this is the Java forum I suggest you post this elsewhere - possibly either JavaScript or PHP.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Oh i c ......
|
|
|
|
|
Help me with java code for dividing a text file into variable size chunks using Rabin finger print and sliding window technique..
Consider a file .
A fixed width sliding window (48 bytes long) will be moving along the contents of the file.
The fingerprint of the contents of the window is found using Rabin finger print algorithm
f is fingerprint( Hash value) of the contents of file
D be the average chunk size,
r be zero
Position where f mod D =r satisfies at that position chunk a file.. Advance the sliding window Continue this till the end of file.
|
|
|
|
|
Where are you stuck exactly ? Nobody here will send you the full code of your program (specially when it looks like homework question).
|
|
|
|
|
Hi all,
I wish to develop a multitenant data analytical application using Netbeans. Could anyone suggest me the procedure or a sample multitenant application,which could be more helpful to for me to proceed further.
Please help me.
Thanks for considering my request..
sangita
|
|
|
|