|
Hi All,
I have added a jPanel Form in my applet project. Now i want to place this jPanel over other forms(Applet window) at run time. For that i created its object in Main applet window and try to place it. But its not visible there. Is there anyone who can catch something and help me . I am adding code as well
//SaveContact is jPanel Form class i want to add
SaveContact objFormSaveContact = new SaveContact();
this.getContentPane().add(objFormSaveContact);
this.getContentPane().validate();
objFormSaveContact.setLocation(200, 50);
objFormSaveContact.setVisible(true);
Thanks.
|
|
|
|
|
Seems like you need to repaint() .
|
|
|
|
|
Hi everyone,
Can someone guide me to a code in java that implements a multithreaded proxy server.
Thanks
|
|
|
|
|
Maybe these guys can.
Peter
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
prateek.rajan89 wrote: Can someone guide me to a code in java that implements a multithreaded proxy server.
Java doesn't implement that.
Perhaps you were looking for a server written in java that implements a proxy server. Since "proxy server" can mean different things that can influence the outcome but in general full function proxy servers are not written in java because java doesn't (easily) support functionality that other languages, such as C++, do.
|
|
|
|
|
import java.io.*;
class print
{
public static void main(String[] args)
{
int[] a = new int[20];
int i=0;
while(i<20)
{
a[i] = i;
System.out.println(a[i]);
i++;
}
}
}
output of above code is :<pre lang="vb">0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
while output of:
import java.io.*;
class print
{
public static void main(String[] args)
{
int[] a = new int[20];
int i=0;
while(i<20)
{
a[i] = i;
i++;
System.out.println(a[i]);
}
}
}
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 20
at print.main(print.java:12)
Plz expalin why "i++" make large difference..
Thnx in advance..
modified 19-Jan-12 17:16pm.
|
|
|
|
|
class Code1{
public static void main(String[] args) {
int[] a = new int[20];
int i=0;
while(i<20) {
a[i] = i;
System.out.println(a[i]);
i++;
}
}
}
class Code2{
public static void main(String[] args) {
int[] a = new int[20];
int i=0;
while(i<20) {
a[i] = i;
i++;
System.out.println(a[i]);
}
}
}
That fit's better to my display, which is more wide than high Also check the renaming of the classes
Code1 increments the value i after the value of a[i] is print out.
Therefor each value of a[] is set and print out different.
in Code2 the Array a[] is initialized. That set's all values of a[] to "0".
After that you set a value of a[] and increment i before print out.
So you get in the print out the next value - which is still "0" and you exceed the limit of the array in the endposition (you try to print a[20] , but the array goes from 0-19 ).
That's why.
|
|
|
|
|
thnx Torsten...thnx very much dear.....
|
|
|
|
|
Nice description
Thanks and Regards,
RK_PRABAKAR
|
|
|
|
|
What is the problem here?
you just incrementing the integer 'i' for checking condition but the value you intend to print is integer array a[] of size 20.For that you must modify your code into
import java.io.*;
class print
{
public static void main(String[] args)
{
int[] a = new int[20];
int i=0;
while(i<=20)
{
i++;
a[i] = i;
System.out.println(a[i]);
}
}
}
output of above code is :
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<div class="signature">Thanks and Regards,
RK_PRABAKAR</div>
|
|
|
|
|
i need the source code for image encryption in java based on hill cipher.somebody plz help............
|
|
|
|
|
bhanu.pratap.99 wrote: i need the source code
Then you need to go and search for it; this site is not here to provide source code to order.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Go write it then!
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
don't listen to them - I'll give you a jump start: JCA[^]
Have fun.
|
|
|
|
|
|
|
Start here[^] and you will find lots of samples that will help.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Show us your homework and we will contribute some advice.
We will help, but we are not doing your work.
|
|
|
|
|
ya help me by giving some instruction don't do my work it is a request sir not an order
|
|
|
|
|
ok, so here are some of MY requirements:
- Make it a Windows-Service[^] (visible in the bottom right task corner). It should start with the OS and as a first log date time and name of the log in.
- You'll need a KeyListener[^]
- Make the log by log4j[^] -> I want daily log files. (Tutorial[^])
- on request I want a print out[^] in PDF Format[^] (Yes, I know the F stands for "Format" but it sounds wired when one says PD Format).
Let's see what you've got in mind.
|
|
|
|
|
anilgoyal1289 wrote: guys
And why would you want that? It sounds like a key-logger to me, which is bad[tm].
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
naa, I assume he's not working for Apple or Google or Facebook. He's just trying to get a poem displayed in a fancy window. You know that kind of stuff.
|
|
|
|
|
no i am not want to make a keylogger for hacking i am just write a program for security in my computer pls help me
|
|
|
|
|
Hi Guys
I write a program,but i want it remain in the running when i exit program.
in other words,when i close program it not exit really and it work in background,
whit out show any things in screen for example icon and ....
like in c# when we set the thread is background property to false or service in C# program.(in J2ME)
thanks advance.
|
|
|
|
|
overwrite the Window.close() method.
And you can also use a WindowListener to react on the event of closing the window to kick additional actions: Clickedy for a tutorial[^]
in the tutorial you'll also find that you can quite simple modify the closing event to just hide but not close the GUI Frame on a SWING implementation.
To make a Java application to run as a Windows Service is also not complicated: Read this article![^]
|
|
|
|