help regarding a java project

sanoob.tv

Dr.gB
hey
im planning to do a ieee project in java.the project title is Packet Hiding Methods for Preventing Selective Jamming Attack
i have never done such projects before.and i have no idea where to start.i do have good knowledge in core java n swing.
but dnt knw where to start.can any one help me.im totally lost
thnx.
 
Do you have knowledge about the project's topic? If no, then I would suggest you to first get an inside on the topic you'll be working on.
 
OP
sanoob.tv

sanoob.tv

Dr.gB
i read an abstract,reading the ieee paper now.
i have only done some standard database application,n android apps so far.wanna do something diffent
 
OP
sanoob.tv

sanoob.tv

Dr.gB
i need to create a simple java app,using swing to send and recieve packets between two laptops connected to a router
 
OP
sanoob.tv

sanoob.tv

Dr.gB
k,thnx any way.
im reading upon tcp in java
can you tell me how to add an image in a java swing app.
is there a custom component.so that i can use image as in visual studio?
 

vickybat

I am the night...I am...
^^ In order read image file from your system, you have to import io package. Check the following code:

Code:
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.*;
import javax.imageio.*;
import javax.swing.*;

public class MyImgPanel extends JPanel {

 private [B]BufferedImage[/B] image;

    public MyImgPanel() {
       try {                
          image = [B]ImageIO[/B].read(new File([B]"your image name and path"[/B]));       // You access this through constructor
       } catch (IOException ex) {
            ex.printStackTrace();
       }
    }

public void paintComponent(Graphics g) {
Graphics2d g2d = (Graphics2d) g;                    // use the Graphics2d class instead of Graphics
        super.paintComponent(g2d);
        g2d.drawImage(image, 0, 0, null);    }                   // see javadoc for more info on the parameters.You can alter the co-ordinates to alter the image

I hope this helps. :)
 
if you want to display a single, fixed everytime, then just place a jLable, remove its text, right click on it and go to it's properties, then select the image in the 'icon' property.
 

dead.night7

Journeyman
i need to create a simple java app,using swing to send and recieve packets between two laptops connected to a router

a basic chat application is what u need with a good understandably of tcp/udp classes in java.net package! have a look at book by joe wigglesworth on networking

k,thnx any way.
im reading upon tcp in java
can you tell me how to add an image in a java swing app.
is there a custom component.so that i can use image as in visual studio?

jLabel has a property for setting images too, have that image inside the same folder as that of your java class!

Good job, great idea...!
 
OP
sanoob.tv

sanoob.tv

Dr.gB
^^ In order read image file from your system, you have to import io package. Check the following code:

Code:
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.*;
import javax.imageio.*;
import javax.swing.*;

public class MyImgPanel extends JPanel {

 private [B]BufferedImage[/B] image;

    public MyImgPanel() {
       try {                
          image = [B]ImageIO[/B].read(new File([B]"your image name and path"[/B]));       // You access this through constructor
       } catch (IOException ex) {
            ex.printStackTrace();
       }
    }

public void paintComponent(Graphics g) {
Graphics2d g2d = (Graphics2d) g;                    // use the Graphics2d class instead of Graphics
        super.paintComponent(g2d);
        g2d.drawImage(image, 0, 0, null);    }                   // see javadoc for more info on the parameters.You can alter the co-ordinates to alter the image

I hope this helps. :)

if you want to display a single, fixed everytime, then just place a jLable, remove its text, right click on it and go to it's properties, then select the image in the 'icon' property.

a basic chat application is what u need with a good understandably of tcp/udp classes in java.net package! have a look at book by joe wigglesworth on networking



jLabel has a property for setting images too, have that image inside the same folder as that of your java class!

Good job, great idea...!


thnx.
i saw the jlabl meathod,but ran in to a problem with pictures of differnt resolutions.
is there a way to scale the picture to the size of jlabel.

and since i have two days off coz of the strike.il try to read up on the book you suggested
 

tutorsonnet

Right off the assembly line
Nice projects but its a heavy tack you have to learn more and lots of java notes are available on web, so please refer online notes
 
Top Bottom