DIGIT-ARC read-only archive · snapshot: July 23, 2026

help regarding a java project

14 posts · originally from https://geek.digit.in/community/threads/help-regarding-a-java-project.170282/

sanoob.tv
sanoob.tv Original post #1
Feb 17, 2013 at 1:14 PM
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.
harshilsharma63
Feb 17, 2013 at 1:24 PM
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.
sanoob.tv
Feb 17, 2013 at 1:30 PM
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
sanoob.tv
Feb 18, 2013 at 7:11 PM
i need to create a simple java app,using swing to send and recieve packets between two laptops connected to a router
harshilsharma63
Feb 18, 2013 at 8:06 PM
Sorry, but I have no clue on this :p . Just read some tutorials and a lot of sample code.
sanoob.tv
Feb 19, 2013 at 11:44 AM
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
Feb 19, 2013 at 1:00 PM
^^ 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. :)
harshilsharma63
Feb 19, 2013 at 4:41 PM
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
Feb 19, 2013 at 9:39 PM
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...!
sanoob.tv
sanoob.tv #10
Feb 19, 2013 at 9:54 PM
^^ 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
harshilsharma63
Feb 20, 2013 at 5:58 PM
No direct way, VB had an auto-resize property for labels, unfortunately, there's nothing such in Java SE.
sanoob.tv
sanoob.tv #12
Mar 3, 2013 at 3:07 AM
any one know how to code a grid view in java(swing) like in .net???
harshilsharma63
Mar 3, 2013 at 8:34 AM
Right click on frame > layout then select the layout you want.

Right click on frame > layout then select the layout you want.
T
Apr 1, 2013 at 11:20 AM
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