A "Paint like" application

Hi,
I'm currently programming an application for my sister and I would like to finish before Christmas, but I'm really late. So to complete a part of it, I'm looking for the source of a paint like application. Just something you use to draw line, circle, rectangle, filling it or not, choosing the color... So If you can give me a link to this kind of source, or post some source It would be great.
Thank you.
S�bastien

With a fill option.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.awt.image.*;
import javax.swing.border.*;
public class PaintLike extends JFrame  implements ActionListener
     PPanel  panel  = new PPanel();
     JPanel  contr  = new JPanel();
     PButton whatt;
     JLabel  whatc;
public PaintLike()
     addWindowListener(new WindowAdapter()
     {     public void windowClosing(WindowEvent ev)
          {     dispose();
               System.exit(0);
     setResizable(false);
     setBounds(10,10,780,500);
     getContentPane().add("Center",panel);
     getContentPane().add("West",contr);
     contr.setLayout(new BorderLayout());
     Border       br = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED,Color.white,Color.gray);
     contr.setBorder(br);
     contr.add("North",addButtons());
     contr.add("Center",new JPanel());
     contr.add("South",addColors());
     setVisible(true);
     panel.requestFocus();
private JPanel addButtons()
     JPanel panel = new JPanel();
     panel.setPreferredSize(new Dimension(70,175));
     panel.setLayout(new GridLayout(5,2,1,1));
     for (int i=0; i < 10; i++)
          PButton jb = new PButton(i);
          jb.addActionListener(this);
          panel.add(jb);
     return(panel);
private JPanel addColors()
     JPanel panel = new JPanel();
     panel.setLayout(new BorderLayout());
     JPanel canel = new JPanel();
     panel.add("North",canel);
     canel.setLayout(new GridLayout(5,4,0,0));
     canel.setPreferredSize(new Dimension(70,90));
     Color[] colors = {Color.black,Color.blue,
                           new Color(152,0,0),new Color(132,66,0),
                           Color.cyan, new Color(219,219,112),
                           Color.gray,Color.green,
                           new Color(200,200,200),
                           Color.magenta,new Color(0,0,108),
                           Color.orange,Color.pink,
                           Color.red,new Color(155,192,210),
                           new Color(230,230,230),new Color(64,224,208),
                           Color.white,Color.yellow};
     for (int i=0; i < colors.length; i++)
          JButton jb = new JButton("");
          jb.setBackground(colors);
          jb.addActionListener(this);
          jb.setRequestFocusEnabled(false);
          canel.add(jb);
     whatc = new JLabel(" ");
     whatc.setOpaque(true);
     whatc.setBackground(Color.blue);
     whatc.setBorder(new MatteBorder(1,1,1,1,Color.black));
     panel.add("Center",whatc);
     return(panel);
public void actionPerformed(ActionEvent ae)
     if (ae.getSource() instanceof PButton) whatt = (PButton)ae.getSource();
     else if (ae.getSource() instanceof JButton)
          whatc.setBackground(((JComponent)ae.getSource()).getBackground());
public class PPanel extends JPanel implements MouseMotionListener, MouseListener
     Point mp,fp,tp;
     Vector objects = new Vector();
     BufferedImage image;
     Graphics2D graph;
public PPanel()
     setBackground(Color.white);
     addMouseMotionListener(this);
     addMouseListener(this);
public void paintComponent(Graphics g)
     super.paintComponent(g);
     if (image == null || image.getWidth(null) != getWidth() ||
                         image.getHeight(null) != getHeight())
          image = (BufferedImage)createImage(getWidth(),getHeight());
          graph = (Graphics2D)image.getGraphics();
          graph.setColor(Color.white);
          graph.fillRect(0,0,getWidth(),getHeight());
          for (int i=0; i < objects.size(); i++)
               PObject po = (PObject)objects.get(i);
               po.draw(graph);
     g.drawImage(image,0,0,null);
     g.setColor(whatc.getBackground());
     if (whatt != null && fp != null)
          if (whatt.type == 0) g.drawLine(fp.x,fp.y,tp.x,tp.y);
          if (whatt.type == 1) g.drawOval(fp.x,fp.y,tp.x-fp.x,tp.y-fp.y);
          if (whatt.type == 2) g.drawRect(fp.x,fp.y,tp.x-fp.x,tp.y-fp.y);
public void mouseDragged(MouseEvent m)
     if (whatt == null) return;
     if (whatt.type > 2) return;
     if (fp == null)
          fp = new Point();
          tp = new Point();
     if (whatt.type == 0)
          fp.setLocation(mp.getLocation());
          tp.setLocation(m.getPoint().getLocation());
     else
          fp.x = Math.min(mp.x,m.getX());
          fp.y = Math.min(mp.y,m.getY());
          tp.x = Math.max(mp.x,m.getX());
          tp.y = Math.max(mp.y,m.getY());
     repaint();
public void mouseMoved(MouseEvent m){}
public void mouseClicked(MouseEvent m)
//     if (whatt.type == 6)
//          fillIt(mp.x,mp.y,image.getRGB(mp.x,mp.y));
//          changeMx(image.getRGB(mp.x,mp.y),mp.x,mp.y);
//          repaint();
public void mouseEntered(MouseEvent m){}
public void mouseExited(MouseEvent m) {}
public void mouseReleased(MouseEvent m)
     if (whatt == null) return;
     if (whatt.type == 6)
          fillIt(mp.x,mp.y,image.getRGB(mp.x,mp.y));
          repaint();
          return;
     if (fp != null)
          PObject po = new PObject(whatt.type,fp,tp,whatc.getBackground());
          objects.add(po);
          po.draw(graph);
          fp = null;
public void mousePressed(MouseEvent m)
     mp = m.getPoint();
public void fillIt(int x, int y, int ogb)
     int ng = whatc.getBackground().getRGB();
     if (ng == ogb) return;
     int[] xv = new int[getWidth()*getHeight()];
     int[] yv = new int[getWidth()*getHeight()];
     int ii = 1;
     image.setRGB(x,y,ng);     
     xv[0] = x;
     yv[0] = y;
     for (int i=0; i < ii; i++)
          int xx = xv[i];
          int yy = yv[i];
          if (xx > 0 && image.getRGB(xx-1,yy) == ogb)
               xv[ii] = xx-1;
               yv[ii] = yy;
               image.setRGB(xx-1,yy,ng);
               ii++;
          if (yy > 0 && image.getRGB(xx,yy-1) == ogb)
               xv[ii] = xx;
               yv[ii] = yy-1;
               image.setRGB(xx,yy-1,ng);
               ii++;
          if (xx < getWidth()-1 && image.getRGB(xx+1,yy) == ogb)
               xv[ii] = xx+1;
               yv[ii] = yy;
               image.setRGB(xx+1,yy,ng);
               ii++;
          if (yy < getHeight()-1 && image.getRGB(xx,yy+1) == ogb)
               xv[ii] = xx;
               yv[ii] = yy+1;
               image.setRGB(xx,yy+1,ng);
               ii++;
public class PButton extends JButton
     int type;
public PButton(int type)
     this.type = type;
public void paintComponent(Graphics g)
     super.paintComponent(g);
     Graphics2D g2 = (Graphics2D)g;
     g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
     g2.setStroke(new BasicStroke(1.2f));
     if (type == 0) g.drawLine(8,8,getWidth()-10,getHeight()-11);     
     if (type == 1) g.drawOval(6,10,getWidth()-13,getHeight()-20);
     if (type == 2) g.drawRect(7,7,getWidth()-15,getHeight()-14);
     if (type == 6) g.drawString("Fill",7,20);
     if (hasFocus())
          g.setColor(Color.gray);
          g.drawRect(4,3,getWidth()-9,getHeight()-7);     
public class PObject extends JComponent
     int type;
     Point fp,tp;
     Color color;
     boolean fill;
public PObject(int type, Point fp, Point tp, Color color)
     this.type = type;
     this.fp = fp;
     this.tp = tp;
     this.color = color;
public void setFill(boolean fill)
     this.fill = fill;
public void draw(Graphics g)
     g.setColor(color);
     if (type == 0) g.drawLine(fp.x,fp.y,tp.x,tp.y);
     if (type == 1) g.drawOval(fp.x,fp.y,tp.x-fp.x,tp.y-fp.y);
     if (type == 2) g.drawRect(fp.x,fp.y,tp.x-fp.x,tp.y-fp.y);
public static void main (String[] args)
     new PaintLike();
Noah

Similar Messages

  • 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.

  • Is there a windows "paint" like application on my macbook?

    if anyone has any tips, id appreciate the knowledge.

    I downloaded several different programs and ended up deleting them all. I could not find one that worked as well as MSPaint. which is sad since wasn't the original 1984 mac known for its paint like program-- GUI interface and all.
    I wanted to take several pictures of the apple logo and put all of them on my desktop as the background and sadly I had to use a windows machine and used paint to do it.
    "My screen name is don't make me switch back, so don't make me answer my questions and tell me why mac is better."

  • "Paint" like Application?

    I looked under Downloads and I couldn't find anything that I was looking for.
    I am looking for an Application something like Paint in Microsoft. Where I can add a text box, etc. Things of that nature.
    Any suggestions on what Applications would fulfill this?
    Thanks

    It depends on the complexity. While "Paint" will allow you to use editing tools such as the pencil, which change the individual pixels on the image, Apple's "Preview" application does allow you to add markup and annotations to certain files. You will have to first save pictures as a PDF, and then open them in preview again to add ovals, rectangles, text, and whatnot using the "Tools" menu. Then you can export the results in an image format such as JPG or PNG. It's a little more involved in this sense, but can be done without third-party software if a simple text box or oval-like markup is all you want to do.

  • Can we design a paint type application with background area is not selected

    Hi All,
    I have the requirement to design MS Paint type application where the user will annotate on the application with pencil like tools. I have one frame containing the JPanel which acting like a slate to annotate. I need to display the JPanel in my application with the background as non-selected like in any PDF viewer and Power Point and the size of the JPanel has to increase or decrease according to the mouse scrolled by the user (Same like what happening MS Word / PDF Viewer).
    Can any one please let me know what approach do i need to follow to achieve this?
    Thanks in advance,
    Uday

    A JPanel is the simplest container class. As you don't want it to contain anything, you don't need that. Use a JComponent.

  • Report builder error after applying sql server 2008R2 SP3 when click on report builder gives error like 'Application validation did not succeed. Unable to continue.

    Hi All,
    I applied SQL server 2008 R2 SP3 recently but report builder doesn't work since then
    When click on report builder gives error like 'Application validation did not succeed. Unable to continue.
    and when I try to see details the error summary like following:
    +File, Microsfot.ReportingServices.ComponentLibrary.Controls.dll, has a different computed hash than specified in manifest.
    this is urgent.
    Please reply me asap.
    thanks a lot in advance.
    Regards,
    Nik
    Regards, Naman

    Hi nikp11,
    According to your description, you recently updated SQL Server 2008 R2 to SP3, Report Builder doesn’t work since then the error occurs: "Application validation did not succeed. Unable to continue".
    This is an known issue in SSRS 2008 R2 SP3 that Microsoft has published an article addressing this issue. It is not planning to release a fix for this issue. But we could implement one of the following workarounds:
    Install and run Report Builder 3.0 of SQL Server 2008 R2 RTM.
    Install and run Report Builder of SQL Server 2014.
    Uninstall Service Pack 3 then uninstall Service Pack 2 and then reinstall Service Pack 3.
    Reference:
    Report Builder of SQL Server 2008 R2 Service Pack 3 does not launch
    Thank you for your understanding.
    Best Regards,
    Wendy Fu

  • Use of uiext.Inbox control in a Fiori-like application

    Hi all,
    I'm investigating Fiori-like custom application development, underlying platform is HCP.
    I need to provide an inbox for BPM tasks and the uiext.Inbox control look pretty cool to me.
    However, I understand it does not belong to the sap.m package where Fiori controls belong.
    Thus, I expect interoperability problems when embedding the uiext.Inbox in a Fiori-like application.
    So I'd be grateful if anyone could clarify
    can uiext.Inbox integrate in a Fiori-like app?
    in case it can't, how could one implement a task inbox on Fiori-like applications?
    Thanks, regards
    Vincenzo

    You can use the # format specifier after the seconds to specify milliseconds.
    For example, you might be using the format string "hh:nn:ss" to currently specify hour, minute, and second. You could add a "." and a "#" for every digit to the right of the decimal to specify milliseconds. For example, if you wanted to specify hour, minute, second, and 2 decimals for the milliseconds, the format string would be "hh:nn:ss.##".
    - Elton

  • 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

  • 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.

  • 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

  • How to control the error messages (like Application..) in visual composer?

    hi
    is it possible to control the error message?
    After creating the delivery using a BAPI function,
    the return message is displayed in the table list if the transaction is succeeded.
    But the error occurred, dialog box is showed (Application Message).
    I just want to show the error message like being succeed in.
    Regards,
    Wooho.

    Hi
    You can try and use guard conditions or check the table for data, if there is no data in the table the application will return an error message.
    Jarrod Williams

  • How to make a HyperCard-like application

    I've written several japplets that do useful things, but they have been "single-screen" applications. This time I have to program a japplet that has multiple screens. On the 1st screen, the user makes a selection. Upon hitting "Next", the 2nd screen appears, where he does something else, etc. etc. Much like a HyperCard or Macromedia Director kind of program. Could somebody help me get started? I thought of making a JPanel for each "screen". But how do I switch from one JPanel to the next? Any help would be much appreciated!

    CardLayout

  • 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

  • Trying to make Scrollable Functionality in Paint like program.

    I'm wrinting a program thats a lot like MSPaint or any of the other paint variants. I have a JPanel that all of my shapes are drawn to. I need the scroll bars to show only when the shapes, which are variants of Shape2D, are to large to be shown in the window. For some reason I just can't make heads or tails of the JScrollPane documentation. If someone can just give me an example of a class that extends JPanel and has the scroll bars on it I think that I could figure it out from there.

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.Line2D;
    import java.util.ArrayList;
    import java.util.List;
    import javax.swing.*;
    public class ScrollView extends JPanel {
        List<Line2D> lines = new ArrayList<Line2D>();
        final int DELTA = 30;
        final int PAD   =  5;
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(Color.blue);
            for(int i = 0; i < lines.size(); i++) {
                g2.draw(lines.get(i));
        public Dimension getPreferredSize() {
            double maxX = 0, maxY = 0;
            for(int i = 0; i < lines.size(); i++) {
                Rectangle r = lines.get(i).getBounds();
                if(r.getMaxX() > maxX) maxX = r.getMaxX();
                if(r.getMaxY() > maxY) maxY = r.getMaxY();
             return new Dimension((int)(maxX+PAD), (int)(maxY+PAD));
        private JPanel getLast() {
            String[] ids = { "width", "height" };
            ActionListener al = new ActionListener() {
                Rectangle rect = new Rectangle(PAD,PAD);
                public void actionPerformed(ActionEvent e) {
                    String id = e.getActionCommand();
                    int w = getWidth();
                    int h = getHeight();
                    double x1 = 0, y1 = 0, x2 = 0, y2 = 0;
                    if(id.equals("width")) {
                        double lineWidth = (w-2*PAD) + DELTA;
                        x1 = PAD;
                        x2 = x1 + lineWidth;
                        y1 = y2 = h - PAD;
                    } else {
                        double lineHeight = (h-2*PAD) + DELTA;
                        x1 = x2 = w - PAD;
                        y1 = PAD;
                        y2 = y1 + lineHeight;
                    lines.add(new Line2D.Double(x1, y1, x2, y2));
                    repaint();
                    revalidate();
                    rect.setLocation((int)x2, (int)y2);
                    scrollRectToVisible(rect);
            JPanel panel = new JPanel();
            for(int i = 0; i < ids.length; i++) {
                JButton button = new JButton(ids);
    button.setActionCommand(ids[i]);
    button.addActionListener(al);
    panel.add(button);
    panel.setBorder(BorderFactory.createTitledBorder("expand"));
    return panel;
    public static void main(String[] args) {
    ScrollView test = new ScrollView();
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.add(new JScrollPane(test));
    f.add(test.getLast(), "Last");
    f.setSize(400,400);
    f.setLocation(200,200);
    f.setVisible(true);

  • How to programming the forum like application

    Hi all
    I want to build an application like a forum that users can put their thing on the site. but I dont have any information and I didnt programming this sort of things.
    I dont think these huge information written by users are saving into databse. I think it will be placed in file somewhere in the server hard drive. Is that right?
    any way, please tell me about this kind of sites and help me out which technologies or API's are available in Java to doing so. I want to use JSF in my application.
    I am new in this field so any suggestion will be usefull and will be appreciated.
    regards
    Mohammad

    Hi
    See u need to follow the following steps
    first check whether ur J2EE Engine Server in your NDS
    the properties Productive USE shuld be "NO" and Debugging Mode to "ON".
    Then u can add break point at the left Corner of your source code and choose Run ¨ Debug... in the main menu.
    u can specify the debugger name adn the project to be debuugged and click on the debug button.
    jusct check whether ur Application is already deployed or not if not check the box deploy new Archive
    please get back for further issues
    Hope i solved your problem
    Krishna kanth
    Message was edited by: krish kanth

Maybe you are looking for

  • Error with SecureStore when installing EHP2 JAVA CI

    Hi we are running into this issue while installing JAVA CI EHP2 on windows system. correct JAVA path exists DB is up I think secstore file might have been corrupted but how to generate a new one ....installation hasn't installed config tool yet so ho

  • Added Background does not appear in PDF

    I tried this and had problems - opened up a Catia sample in Toolkit, used 'Open Background' to add a jpeg background (blue waves). Worked fine, and when I exported to .u3d, then opened that, I could see that the background was there as you'd expect -

  • OS X Yosemite can't install

    My Macbook isn't allowing me to install the new OS X Yosemite even though I've backed up my computer, and it is compatible as it is a late 2008 model. And when I go in to the App Store, it is giving me this notification below. Please Help, what do I

  • Assign value to asset under construction

    Hi Sirs, I would like to know what i have to do to solve the problem with value for asset under construction. When I create asset with tr. AS91 in area for Takeover values, the field for ***.acquis.val. is not active. Thank you in advance. Regards, D

  • Upload .csv with ; delimitor

    Hello , can we handle .csv file with ; (semi colon) delimitor , may be Presentation server ot app server . if so please  provide me the solution thanks