|
|
hi
where i can find one telnet client source code for interactive with any telnet server ?
thanks
|
|
|
|
|
navidnmc wrote: where i can find one telnet client source code for interactive with any telnet server ?
All over the internet; a quick Google will yield many samples.
I must get a clever new signature for 2011.
|
|
|
|
|
On Google. I did a search for "telnet client source code" and got over 8 million hits. At least one of them must be relevant.
|
|
|
|
|
is Google down again?
Try "Java Telnet" for your search and you will find something like this:
JAVA SSH[^]
regards
Torsten
I never finish anyth...
|
|
|
|
|
|
You can find many article like this[^] one you can also go there[^]
|
|
|
|
|
I am having some issues the the implementation of the JScrollPane in my gui. I was wondering if anybody had any ideas?
For my GUI i the following
JFrame
>JPanel (nav bar)
>JPanel (gridlayout dynamic based on house size)
>> JPanel(each grid/cell)
>>> Componts (label etc)
>> JPanel (Stat bar)
This works fine to select and work with my rooms(part of the project) in each grid. I have the listener attached to the gridlayout panel, so i know where my mouse has clicked and therefore which grid it belongs to. The listener is the mouselistener on the JPanel.
But when i place a JScrollPane in here;
JFrame
>JPanel (nav bar)
>JPanel (gridlayout dynamic based on house size)
>>jScrollPane
>>>JPanel(each grid/cell)
>>>>Components (label etc)
>>>JPanel (Stat bar)
To give me the scroll bars for each room, my gui no longer accepts the mouse event (it does but not on the gridlayout JPanel as it did before). Does anybody know how i can overide the JScrollPane and let my JPanel underneath receive the event?
I am struggle to find a way to do this that will adhere to the MVC structure. As the code to check and prepare everything is in the controller which just hands the basic info over to the view to repaint it all.
Or i am just completely going in the wrong direction
|
|
|
|
|
This might get a bit complicated..
can you set up a Listerner object, which the parent JPanel hands down to the JScrollPanel underneath? That would make it a bit less confusing.
I'm not sure if you can get the well formated event you expect when clicking in the JScrollPanel[^], as this one is not a static view, but has a JViewport, which is just one part of the visual components included in this component. A JScrollPanel is a combination of different parts. Maybe you just have to deal with the JViewport[^]
regards
Torsten
I never finish anyth...
|
|
|
|
|
Cheers, I manged to find a different way, I added a couple of subs to a custom class of the scrollpane and used that to interact with the listener. Unfortunately it all happens in the view instead the controller but it works.
Thank you your help.
|
|
|
|
|
Unfortunately it all happens in the view instead the controller
..this was why I suggested an object for the command.
Did you use the JViewport or is it enough to let the fun happen in the JScrollPane?
regards
Torsten
I never finish anyth...
|
|
|
|
|
any idea how to do it , as i have a main Jframe and another data frame which previews and print the data in JTable ,now my problem is when i execute my code to print then flush the jtable data, it works vice-versa, as it flushes all the data in jtable then shows the preview frame.
it is as:
{
functionshow_print_preview();
functionflush_table_and_refresh();
}
|
|
|
|
|
Java will execute the code in the exact same order as you write it. So if you have the calls to those two functions below one and other like:
<br />
{<br />
functionshow_print_preview();<br />
functionflush_table_and_refresh();<br />
}<br />
then they will be called in the following order:
- functionshow_print_preview
- functionflush_table_and_refresh
The only thing I can think of is that you start a seperate thread somewhere within either of these two functions causing them to be executed out of sync.
|
|
|
|
|
see that is the problem , i know it has to be this way but priview shows as a blank jtable as the number 2 executes while first is in middle of execution (taking the jtable data of mainframe), any solution??......
|
|
|
|
|
you're right - and not right.
The methods are called in this order, but the printer job takes some more time. In the meanwhile the table is deleted.
@ Alok
try to return a value from the print job, a signal to mark when the job is done. Set up a loop (or use another thread) which interrupts the code as long as the print job takes.
regards
Torsten
I never finish anyth...
|
|
|
|
|
|
hi
I have a text file with large content in it .
how i can find specified word in this text file and replace it word with another word in entire file ?
please help me
modified on Saturday, February 12, 2011 4:15 AM
|
|
|
|
|
Most likely the replacement string will not be exactly the same size as the search string. In that case you need to create a copy of the original file replacing the search text everytime it occurs.
I am assuming you are talking properly large as in > 25% of the machine memory. If it is not too large then, laod the file into a StringBuilder and use indexOf to find the text and replace to replace it.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
|
|
|
|
|
hi frnds
can anyone there help me out for placing an audio instead of text in an image plz help me out
|
|
|
|
|
Try using Liquid Nitrogen
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
|
|
|
|
|
Hi,
the correct term is steganography. Google knows about it, and CodeProject hosts several articles about it.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I am not Much sure about it but suggesting you to navigate this link[^] to know abut stenography in details
|
|
|
|
|
import java.awt.*;
public class NewClass2 {
public static void main(String args[]){
Image image = Toolkit.getDefaultToolkit().getImage("file:///D:/usage/a.JPG") ;
int width = image.getWidth(null);
int height = image.getHeight(null);
System.out.println("height"+height);
System.out.println("width"+width);
}
}
while executing this code we doesn't get any error, but we cant get the image
Instead we get the width and height is -1;
|
|
|
|
|
Please use code block tags for your code.
|
|
|
|
|
import java.awt.Image;
import java.awt.Toolkit;
public class NewClass2 {
public static void main(String args[]){
Image image = Toolkit.getDefaultToolkit().getImage("D:/usage/a.JPG") ;
int width = image.getWidth(null);
int height = image.getHeight(null);
System.out.println("height"+height);
System.out.println("width"+width);
}
}
...simlpy because the image is not found. I have changed the path String.
Image java.awt.Toolkit.getImage(String filename)
getImage
public abstract Image getImage(String filename)
Returns an image which gets pixel data from the specified file, whose format can be either GIF, JPEG or PNG. The underlying toolkit attempts to resolve multiple requests with the same filename to the same returned Image.
Since the mechanism required to facilitate this sharing of Image objects may continue to hold onto images that are no longer in use for an indefinite period of time, developers are encouraged to implement their own caching of images by using the createImage variant wherever available. If the image data contained in the specified file changes, the Image object returned from this method may still contain stale information which was loaded from the file after a prior call. Previously loaded image data can be manually discarded by calling the flush method on the returned Image.
This method first checks if there is a security manager installed. If so, the method calls the security manager's checkRead method with the file specified to ensure that the access to the image is allowed.
Parameters:
filename - the name of a file containing pixel data in a recognized file format.
Returns:
an image which gets its pixel data from the specified file.
Throws:
SecurityException - if a security manager exists and its checkRead method doesn't allow the operation.
See Also:
createImage(java.lang.String)
--------------------------------------------------------------------------------
int java.awt.Image.getWidth(ImageObserver observer)
getWidth
public abstract int getWidth(ImageObserver observer)
Determines the width of the image. If the width is not yet known, this method returns -1 and the specified ImageObserver object is notified later.
Parameters:
observer - an object waiting for the image to be loaded.
Returns:
the width of this image, or -1 if the width is not yet known.
See Also:
getHeight(java.awt.image.ImageObserver), ImageObserver
regards
Torsten
I never finish anyth...
|
|
|
|