Trying to code a ethereal-like application

Hi all.
I am trying to code a mini-etheral like packet logging/attacks detection utility for security purposes. It will be very easy to do it in C but i wish to do it in Java. I want to print all the packet dump in hexadecimal on a notepad or text editor or something. I also want to detect which IP address is trying to attack you and print it to text etc (this part won't be too hard)
The problem is, i cannot find any tutorial on google teaching something similiar to this. Does anyone know any links related to this? Please help out if you do. I already have Java as well as some network programming knowledge so basically, i just need a good example similiar to what i am trying to create.
Much appreciated !

Hello,
In order to make it painted all the time you have to override the method
paint(Graphics g) in the JFrame class. In your program you have to override it either in the TLayer class or in the GameScreen class.
This is the new GameScreen class after this modification; this makes the rectangle painted after resizing.
import java.awt.Graphics;
public class GameScreen extends TLayer {
     private PoolApp thePoolApp;
     public GameScreen(PoolApp aPoolApp) {
          thePoolApp = aPoolApp; // set a reference from here to the controlling
                                        // PoolApp initGameScreen(); //initialise and
                                        // show GameScreen .....screen
          initGameScreen();
     public void initGameScreen() {
          this.setSize(800, 600);
          this.show();
          // now make a request to the poolapp controlling class to ask for a
          // painted green table and get the paint class to paint it to screen
          thePoolApp.getPaintedTable(this);
     public void paint(Graphics arg0) {
          super.paint(arg0);
          thePoolApp.getPaintedTable(this);
}Hope this helps you.
Feel free to ask, if you have any question .
Regards,
Ahmed Saad

Similar Messages

  • Wizard-like application using ADF

    I am trying to develop a wizard-like application that goes through multiple screens, storing data of each screen into a session and finally saving it to the database at the end of the wizard. Is there a built-in taskflow or component that can do this ? Otherwise, any example code that I can refer to.?

    Hi,
    have a look at sample #40 on ADF Code Corner - http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html
    It explains how to defer ADF binding validation for until the end of a wizard action, or in the sample using partial af:subform submits. Seems easier to me to create a wizard flow based on an ADF binding than to juggle a managed bean from start to end
    Frank

  • TS1646 I'v tried many times to update my applications however, my account can't do it because security code for my card is incorrect note that I'm sure my card details are correct completely so i need help to fix it as much as you can plz. Thnks

    Hi
    I'v tried many times to update my applications however, my account can't do it because security code for my card is incorrect note that I'm sure my card details are correct completely so i need help to fix it as much as you can plz. Thnks

    Look, I understand I still need a card attached to the account. The problem is, it won't accept my card because I only have 87 cents in my bank account right now.
    If I had known there would be so much trouble with the iTunes card, I would have just put the cash in my bank account in the morning instead of buying an iTunes card (I didn't expect the banks to be open on Thanksgiving of course).
    Apple will only accept cards that have a balance. The balance is so small in my account that it won't accept it as a valid card.
    I'm going to have to contact Apple anyway to reset the security questions. That's obvious. Your answers were not exactly helpful. You didn't tell me anything I don't already know, but thanks for trying to be helpful.

  • Trying to code a pool game but the initial shape dissapears!!! im stuck!

    Hi ,
    I basically want to write a java graphics game application ......At this point in time all I want to do is add a green rectangle to the content pane.......I can do this but I want to stick with OO concepts so I have various classes......the thing is ....when a user resizes the window the graphic I have painted dissapeared
    I will show the classes I have used and the code below......I want to do the program conforming to the way I was tought java which is to have a main controlling class that orchestrates communication between unrelated classes and their methods. In addition to my question if anyone sees stuff fundementally wrong with my code and has a better solution please feel free to enlighten me :-)
    main controlling class:
    import java.awt.Graphics;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2005</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class PoolApp {
    public PoolApp() {
    //creates new gamescreen object
    GameScreen aScreen = new GameScreen(this);
    public static void main(String[] args) {
    PoolApp poolApp1 = new PoolApp();
    public Graphics getPaintedTable(GameScreen aGameScreen) {
    Paint aPaint = new Paint(this);
    Graphics tblObj = aPaint.getTbleGraphic(aGameScreen);
    return tblObj;
    ------end main controlling class
    ------TLayer Class start
    import javax.swing.*;
    /* The purpose of this class was to create a generic frame that would
    be inherited from all screen classes ...I initially had this creating a black background that would be inherited from child classes but that created
    more problems when the screen was resized by one of the child classes*/
    public class TLayer extends JFrame {
    public TLayer() {
    -----TLayer Class end
    -----GameScreen class start--------
    public class GameScreen extends TLayer{
    private PoolApp thePoolApp;
    public GameScreen(PoolApp aPoolApp) {
    thePoolApp = aPoolApp; //set a reference from here to the controlling PoolApp initGameScreen(); //initialise and show GameScreen .....screen
    public void initGameScreen() {
    this.setSize(800,600);
    this.show();
    //now make a request to the poolapp controlling class to ask for a painted green table and get the paint class to paint it to screen
    thePoolApp.getPaintedTable(this);
    ----GameScreen class end------------
    ----PaintScreen class start-------------
    PoolApp thePoolApp;
    public Paint() {
    public Paint(PoolApp apoolApp) {
    thePoolApp = apoolApp;
    public Graphics getTbleGraphic(GameScreen aGameScreen) {
    Container theCont = aGameScreen.getContentPane(); //assign the gamescreen content pane to a container
    theCont.setSize(200,200); //set a viewable size to the container
    Graphics thetbl = theCont.getGraphics(); //get container graphics context and assign it to a graphics object
    thetbl.setColor(Color.green); //color the object
    thetbl.fillRect(30,30,20,60); //fill the rectangle
    return thetbl; //return the object
    ---PaintScreen class end---------------
    This code actually draws the green rectangle to the gamescreen from the paint class .......so it works to a degree! ......whenever I resize the window the painted image dissapears, could anyone suggest a way around this also ...am I going about this the correct way? Im open to making mass changes to better the program ......the only thing I do not want is to use applets! .....as I want to learn the fundementals of custom painting my stuff
    also I tried altering the paint class like so:<as well as many other suggested ways>
    public class Paint extends TLayer
    Graphics g;
    PoolApp thePoolApp;
    GameScreen theGameScreen;
    public Paint() {
    public Paint(PoolApp apoolApp) {
    thePoolApp = apoolApp;
    public Graphics getTbleGraphic(GameScreen aGameScreen) {
    theGameScreen = aGameScreen;
    paint(g,aGameScreen);
    return g;
    public void paint(Graphics g,GameScreen aGameScreen) {
    super.repaint();
    // draw your green rectangle here
    Container c = aGameScreen.getContentPane();
    Graphics thetbl = c.getGraphics();
    thetbl.setColor(Color.green);
    thetbl.fillRect(30,30,20,60);
    I can get painting working but ...to be honest it would mean lumping things all together and Im trying to make
    my program OO ...so that kind of defeats the purpose...Im really looking for an answer that is not generic ....in the sense that it will work for this program specifically.....
    I have done lots of reading and tried the usual things .....I know reasnably well whats happening for the code to be drawn
    but the fact that I have seperated classes based on there specific purposes ...it has made it tricky to stop the painted image vanishing when I
    resize the screen.......I ask whoever is viewing this code to check out what classes inherits from each other. I have also tried overidding the paint and paintComponents methods but
    the same annoying thing still happens
    Any help is much needed and appreciated
    David

    Hello,
    In order to make it painted all the time you have to override the method
    paint(Graphics g) in the JFrame class. In your program you have to override it either in the TLayer class or in the GameScreen class.
    This is the new GameScreen class after this modification; this makes the rectangle painted after resizing.
    import java.awt.Graphics;
    public class GameScreen extends TLayer {
         private PoolApp thePoolApp;
         public GameScreen(PoolApp aPoolApp) {
              thePoolApp = aPoolApp; // set a reference from here to the controlling
                                            // PoolApp initGameScreen(); //initialise and
                                            // show GameScreen .....screen
              initGameScreen();
         public void initGameScreen() {
              this.setSize(800, 600);
              this.show();
              // now make a request to the poolapp controlling class to ask for a
              // painted green table and get the paint class to paint it to screen
              thePoolApp.getPaintedTable(this);
         public void paint(Graphics arg0) {
              super.paint(arg0);
              thePoolApp.getPaintedTable(this);
    }Hope this helps you.
    Feel free to ask, if you have any question .
    Regards,
    Ahmed Saad

  • JScrollPane, JPanel used to make a paint-like application

    I am new to swing. I need help with implementing a paint-like application using JScrollPane and JPanel.
    I have put a JPanel inside a JScrollPane.
    The size of JPanel exceeds preferred size of JScrollPane, and i can see the scrollbars, and can go up and down.
    Problem is, when i draw on the JPanel, i can see what i've drawn very clearly. Now if I scroll down, and then scroll back up, whatever i had previously drawn has been erased.
    let me put it in a simpler manner. suppose i have drawn a filled circle whose diameter is equal to the viewport size of the JScrollPane. Now i am scrolling down till i can see only the bottom half of the circle. When i scroll back up, the upper half of the circle has been erased.
    i think this is a newbie error, and i guess it'll have a textbook response, so i have not bothered to paste my entire code here. however, if it is required, please let me know.

    Sounds very much like you're painting outside the paint cycle. Read this,
    http://java.sun.com/products/jfc/tsc/articles/painting/
    When the user draws on the screen, you want to do one of two things (these being just the most obvious and easiest implementations). For raster operations you want to manipulate an Image; for vector operations you want to manipulate a collection of Shapes.
    Your paintComponent() method of the panel should simply draw the stored images and shapes to the supplied Graphics object as appropriate.
    If you paint to a Graphics object outside the paint cycle then it will all be erased when the paint cycle is next invoked.

  • Flex iPad Application : Run code before application enters background  Application Type: Flex Mobile Application Target Platform: iPad AIR Version: 4.0 Development Environment: Flash builder 4.6  I want to run some code just before iphone application goes

    Application Type: Flex Mobile Application
    Target Platform: iPad
    AIR Version: 4.0
    Development Environment: Flash builder 4.6
    I want to run some code just before iphone application goes into background. I need function similar to didEnterBackground
    of native xcode app
    (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplicationDelegat e_Protocol/Reference/Reference.h
    tml#//apple_ref/occ/intfm/UIApplicationDelegate/applicationDidEnterBackground:)
    I tried using devactivated function of flash.display.STAGE.
    I used following addEventListener:
    STAGE = this.parent.stage;
    STAGE.addEventListener(Event.DEACTIVATE, onAppDeactivated);
    It worked for me but only when device is connected to development environment in debug mode. When I create my release build
    it is not working.
    So how can I make sure that my code runs before application goes into background.

    Even I am facing almost same issue
    Problem installing Adhoc version to iPhone and iPad - Development Environment Is - Adobe Flash CS6

  • Embed labview generated code with c++ gui application

    Hey everyone ,
      I am very new to labview and trying to learn it  ... but before that i wanted to make sure a doubt which i have in my mind , the problem is that i have a realtime GUI application built on c++ widgets and i want to change the existing DSP block in this application with the code generated by using the LABVIEW , i am sorry that have very
    less amount of knowledge regarding labview so i turn up with thread ... So can generate c++ code for the DSP blocks designed in labview ... if yes how and if not why . Any
    sincere help will be appreciated . And I very much apologise for any mistakes in my question .
    Thanks

    Tonph wrote:
    Thanks rolf, is it possible that i use labview to disign my DSP block only and the output be fed to my custom c++ blocks and also wxwidget GUI ... suggest some means thanks ...
    Well, have you followed the link I gave in my post? You can download an evaluation version of the add-on and try it out in LabVIEW. It generates C code, not C++, but that should be no problem, since it is very easy to call C code from a C++ application. I can't vouch for the suitability of this add-on for you, nor do I know the exact price range so that are certainly things you have to do for your own.
    As to nathans solution, that could work too. If your application is for Windows, or MacOS X, or Linux you can create a shared library from your LabVIEW code and call it as such from your C++ application.
    Personally I would find it a rather roundabout way to include LabVIEW generated code in a wxWidget application. One of the strengths of LabVIEW is not only signal acquisition and analysis but also simple GUI design, at least as long as you are after a functional GUI, and not a very specific style of a GUI. So I would never even consider to do the GUI part with anything but LabVIEW if some other parts are already to be done in LabVIEW.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Browser Like Application

    Hi Everyone,
    I am going to create a browser-like application in Java. This application can read and render html file. Links provided in the html file is an information to any application and if click, it launches the specified application.
    At first, I created an Active-X control and a sample html file that uses this active-X control. Specified in the PARAM of the OBJECT tag is the application path as well as the application exe file. So when the Active-X control is clicked,
    it launches the specified application (set in the PARAM). But my manager told me not to use any browser but to create my own browser in Java.
    Does anyone has any idea how to implement a browser like application? I may be using DTD to create a set of properties like the OBJECT tag. Any help is greatly appreciated.
    Thank you very much,
    Ferdinand

    hi,
    I am just giving a code written in swings for simple web browser.This may not have much features but it is functional. Hope it would help you.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    /** Very simplistic "Web browser" using Swing. Supply a URL on the
    * command line to see it initially, and to set the destination
    * of the "home" button.
    public class Browser extends JFrame implements HyperlinkListener,
    ActionListener {
    public static void main(String[] args) {
    if (args.length == 0)
    new Browser("http://www.yahoo.com");
    else
    new Browser(args[0]);
    private JIconButton homeButton;
    private JTextField urlField;
    private JEditorPane htmlPane;
    private String initialURL;
    public Browser(String initialURL) {
    super("Simple Swing Browser");
    this.initialURL = initialURL;
    // addWindowListener(new ExitListener());
    // WindowUtilities.setNativeLookAndFeel();
    JPanel topPanel = new JPanel();
    topPanel.setBackground(Color.lightGray);
    homeButton = new JIconButton("home.gif");
    homeButton.addActionListener(this);
    JLabel urlLabel = new JLabel("URL:");
    urlField = new JTextField(30);
    urlField.setText(initialURL);
    urlField.addActionListener(this);
    topPanel.add(homeButton);
    topPanel.add(urlLabel);
    topPanel.add(urlField);
    getContentPane().add(topPanel, BorderLayout.NORTH);
    try {
    htmlPane = new JEditorPane(initialURL);
    htmlPane.setEditable(false);
    htmlPane.addHyperlinkListener(this);
    JScrollPane scrollPane = new JScrollPane(htmlPane);
    getContentPane().add(scrollPane, BorderLayout.CENTER);
    } catch(IOException ioe) {
    warnUser("Can't build HTML pane for " + initialURL
    + ": " + ioe);
    Dimension screenSize = getToolkit().getScreenSize();
    int width = screenSize.width * 8 / 10;
    int height = screenSize.height * 8 / 10;
    setBounds(width/8, height/8, width, height);
    setVisible(true);
    public void actionPerformed(ActionEvent event) {
    String url;
    if (event.getSource() == urlField)
    url = urlField.getText();
    else // Clicked "home" button instead of entering URL
    url = initialURL;
    try {
    htmlPane.setPage(new URL(url));
    urlField.setText(url);
    } catch(IOException ioe) {
    warnUser("Can't follow link to " + url + ": " + ioe);
    public void hyperlinkUpdate(HyperlinkEvent event) {
    if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    try {
    htmlPane.setPage(event.getURL());
    urlField.setText(event.getURL().toExternalForm());
    } catch(IOException ioe) {
    warnUser("Can't follow link to "
    + event.getURL().toExternalForm() + ": " + ioe);
    private void warnUser(String message) {
    JOptionPane.showMessageDialog(this, message, "Error",
    JOptionPane.ERROR_MESSAGE);
    import javax.swing.*;
    public class JIconButton extends JButton {
    public JIconButton(String file) {
    super(new ImageIcon(file));
    setContentAreaFilled(false);
    setBorderPainted(false);
    setFocusPainted(false);
    Bye.
    -Dani

  • Code Review:: ADF BC applications

    Hi,
    We would like to know if there's any open source software available for code reviews of ADF applications and how to effectively use to for ADF BC applications?
    1) Am I moving in right direction while exploring PMD and Checkstyle? Are these the right candidates for setting automated code reviews for ADF applications?
    Is there a specific software recommendation by the forum members which can help me achieve this goal.
    2) Can CodeCoach and Audit features available in JDeveloper help me in this?
    3) Will I have to necessary create 'Custom Rules' for tasks like validating EO classes are not directly referred in the Controller? Are there some pre-built rule-sets available on this front?
    4) Any other suggestions for ensuring better/faster code reviews not necessarily replacing the manual peer review process but reducing the unnecessary headaches that can be fixed by freely available software
    Sid

    I started using ADFLogger and added some log statements. When I ran my application in JDeveloper in Embeded OC4J server, these log statements are appearing in JDeveloper server log window. After I deployed this application to Oracle Application Server, these statements are not appearing in the application.log file and also not in any file. Am I missing any configuration setting? The log current level is INFO and I do have few INFO statements, SEVERE statements in my code. Thanks in advance.

  • Trying to customize a facebook like button

    I am trying to add a facebook like button to my website. I have gone through the facebook add like button and gotten the coding. The problem is that it displays the logo and name of business, I don't want that displayed. Can someone help with what I need to do to the coding to prevent that from showing?
    I have tried other forums and google, but nothing seems to answer this particular question.
    THANK YOU!

    You can get all the nessary codes you need from this link:
    <http://twitterbuttons.sociableblog.com/facebook-badges.html>
    When you use these codes, you get the appropriate logos associated with the code as shown on top of the codes.  Please try them on your test page before rolling out on production.
    hth

  • Ds-console like application !

    Hi Flexers,
    I'm currently working on a ds-console like application and i got some problems with data management and variable handling. I started reading the ds-console code, concentrated on the ConsoleManager class, but i think i don't hava that much time to do so ...
    Is it possible to get the ds-console spec and conception?
    My aim after this work is to monitor clients using the FlexSessionId, who's still connected, pending sessions, ...
    The application i want to monitor is made of blazeds (+ java).
    thanks in advance.

    I figured it out. Just change the <display-name> in the web.xml
    Bruce
    On Mon, Mar 24, 2008 at 4:09 PM, Bruce Hopkins <
    [email protected]> wrote:
    A new discussion was started by Bruce Hopkins in
    General Discussion --
      DS Console Application - detecting new BlazeDS apps
    Hi,
    I copied the "samples" application and renamed it, but the DS Console application is won't recognize that another application has been deployed to Tomcat. The Application ComboBox only shows "BlazeDS" and "Samples". What magic do I need to do in order to enable this?
    Thanks,
    Bruce
    View/reply at
    DS Console Application - detecting new BlazeDS apps
    Replies by email are OK.
    Use the
    unsubscribe form to cancel your email subscription.

  • TS3772 Hi Team, I fairly new at this & I'm trying for the first time to download a movie, however its not allowing me to play as it says I need to download quicktime which I have tried to do, I have this application now but its still not allowing me to vi

    Hi Team, I am fairly new at this & I'm trying for the first time to download a movie, however its not allowing me to play as it says I need to download quicktime which I have tried to do, I have this application now but its still not allowing me to play movie, any help please for someone who hasnt got a clue

    where did you download the movie from?
    what is it doing when it wont allow you to play the movie?
    since you downloaded quicktime is it still asking you to download quicktime?

  • Some of my photos in iphoto turn blank (white) when I tried to edit the size like zoon in and out.Can someone help me on this?

    Some of my photos in Iphoto turn blank (white) when I tried to edit the size like zoon in and out.Can someone help me on this?

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • Hi. I get the following message when trying to update or install an application: "impossible to connect to iTunes store". Does anyone know how to fix this? Thanks!

    Hi. I get the following message when trying to update or install an application: "impossible to connect to iTunes store". Does anyone know how to fix this? Thanks!

    Try updating your iTunes using an iTunesSetup.exe (or iTunes64Setup.exe) installer file downloaded from the Apple website:
    http://www.apple.com/itunes/download/

  • I tried to download a Cisco webex application.  The app did not download and I also can't open the app.  The problem is that I can't get the webex screen to close, it is stuck open and I can't get back to the app home page!

    I tried to download a Cisco website application.   The app did not download and it is stuck on the window where it has the option of open.....it will not open.  The problem is that I cannot get the window off the screen and I can't get back to the App Store home page!   Help! Thanks

    Try this.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

Maybe you are looking for

  • How can I create a linkable TOC on the left using Acrobat XI Pro?

    I am completely new to making PDFs. I have a User Manual that I created in Word and would like to have a TOC on the left for easy access to the topics. How can I do this?

  • 保存先の指定

    プリンタのプロパティのポートの指定は.他のアプリで印刷のプリンタをAdobe PDFにした場合に 指定できる保存先フォルダなのですが. Adobe Acrobat 6.0 Standard を起動して.「PDFの作成」からファイルとスキャナでそれぞれ取り込んだ後に.メニューバーの「ファイル」から「名前を付けて保存」か.アイコンの 「上書き保存」を選んだときのデフォルトの保存先を設定するにはどうしたらいいでしょうか? XP Pro SP2 Adobe Acrobat 6.0 Standard

  • Terminating event -- No active receiver found

    Hi -- on an Integration project I just need a workitem that stays active until explicitly closed via an event.. It's easy enough to create a triggering event which starts a process. I've followed all the rules (as far as I can see) to create a termin

  • Expired certificate unexpectedly works under JRE 1.4.2_06+

    Hi, I have a client trust store for server authentication containing an expired certificate. Under JRE 1.4.2_06 (and 1.5) the expiry is ignored (unexpected), however under 1.3 and 1.2 using the same code it is considered invalid (as expected). Why ha

  • Database access from Managed/Backing bean

    Hi, I would like to authenticate web users from a database table, I get the account details in the Welcome page, I wish to check if the user exists in the table (from the managed bean), how do I do this? Is this good practice to access the db from ma