Results 1 to 2 of 2
  1. #1
    cachico12 is offline Member
    Join Date
    May 2011
    Posts
    2
    Rep Power
    0

    Default so i need help finishing my histogram plz help

    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;


    public class MyProject
    {
    public class MyGraph extends JFrame
    {
    DrawPanel drawArea=new DrawPanel();
    int winWidth;
    int winHeight;

    public MyGraph()
    {
    setTitle("Name popularity ");
    getContentPane().add(drawArea);
    drawArea.setBackground(new Color(0,255,0));
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    pack();
    }

    class DrawPanel extends JPanel
    {
    public DrawPanel()
    {
    winWidth=400;
    winHeight=400;

    setPreferredSize(new Dimension(winWidth,winHeight));
    }
    protected void paintComponent (Graphics g)
    {
    super.paintComponent (g);
    double xmin=-2*Math.PI;
    double xmax=8*Math.PI;
    double ymin=-2;
    double ymax=2;
    double x,y,xold,yold;
    MyWorld w2p= new MyWorld(xmin,xmax,ymin,ymax,300,300);
    }
    public class FileInput

    {
    public static void main(String[]args) throws IOException
    {
    BufferedReader kb_in=new BufferedReader(
    new InputStreamReader(System.in));
    System.out.print("Enter the name of the file to be read:");
    String filename=kb_in.readLine();
    BufferedReader file_in=new BufferedReader(
    new FileReader(filename));
    System.out.println("Contents of file:");
    String line=file_in.readLine();
    while(line !=null)
    {
    System.out.println(line);
    line=file_in.readLine();
    }
    }
    }
    }
    }
    }

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Please give more details and edit your post to have your code in code tags.

    To add code tags do this
    [code]
    YOUR CODE HERE
    [/code]

    As to giving more advice, please provide exact error message if there are errors, and also ask some specific questions rather than just dumping code.

Similar Threads

  1. need help with name histogram
    By cachico12 in forum New To Java
    Replies: 1
    Last Post: 05-09-2011, 08:27 AM
  2. Replies: 11
    Last Post: 04-26-2011, 07:55 AM
  3. JAI Histogram error
    By deepsri in forum Advanced Java
    Replies: 0
    Last Post: 01-07-2011, 10:06 AM
  4. finishing up a DB/Java exercise
    By hayden06f4i in forum New To Java
    Replies: 47
    Last Post: 12-12-2010, 09:57 PM
  5. histogram
    By little_man in forum New To Java
    Replies: 4
    Last Post: 11-13-2010, 01:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •