sakshi saw

Greenhorn
+ Follow
since Jun 06, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sakshi saw

Below is a short code to explain the problem i am facing
i have been working on the same for past one week i am facing exceptions while reading a file containing more than one objects



would be very grateful for early reply!
11 years ago
sir i have pasted the whole code i even tried to to debug it using watches it gets stuck after
super()

Sir i am new to it and i am seriously confused i have even removed the line add(scroll);
from constructor
btw was it correct to place it there becuse panel has not been constructed fully and i was adding it
11 years ago
sir please i have not been able to solve the problem i went through JScrollPane constructos i dont think the mistake is here!
11 years ago
hi could you clear my doubt regarding using init() in case of awt and main in case of swing??

and what should come in start() and init().


11 years ago
hi
i have an application in awt
which i need to convert to swing

i have a Canvas on which lines are to be drawn so which swing component do you guide

is it JPanel and what should i use for drawing lines which graphics class

please reply soon

11 years ago
please guide for the following error
applet not initialsed.


i have pasted mycode below

package mypack;

import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class NewJApplet extends JApplet {

/**
* Initialization method that will be called after the applet is loaded
* into the browser.
*/
public void init() {
// JFrame MyFrame=new JFrame("COMPONENT DISPLAYER");
Mypanel jp=new Mypanel();
// add(MyFrame);
add(jp);
// TODO start asynchronous download of heavy resources
}

// TODO overwrite start(), stop() and destroy() methods

}
package mypack;

import java.awt.Color;
import javax.swing.BorderFactory;
import javax.swing.JPanel;

/**
*
* @author
*/
public class Mypanel extends JPanel{

private MyScrollPane scroll;

public Mypanel() {

setBorder(BorderFactory.createLineBorder(Color.BLACK));
scroll=new MyScrollPane();
add(scroll);

}


}

package mypack;
import java.awt.Color;
import javax.swing.*;
/**
*
* @author
*/
public class MyScrollPane extends JScrollPane{

public MyScrollPane() {
super();
// super(VERTICAL_SCROLLBAR_ALWAYS,HORIZONTAL_SCROLLBAR_ALWAYS);
setBackground(Color.BLUE);
}


}


the output is below-

java.lang.IllegalArgumentException: invalid verticalScrollBarPolicy
at javax.swing.JScrollPane.setVerticalScrollBarPolicy(JScrollPane.java:466)
at javax.swing.JScrollPane.<init>(JScrollPane.java:258)
at javax.swing.JScrollPane.<init>(JScrollPane.java:304)
at mypack.MyScrollPane.<init>(MyScrollPane.java:16)
at mypack.Mypanel.<init>(Mypanel.java:23)
at mypack.NewJApplet.init(NewJApplet.java:24)
at sun.applet.AppletPanel.run(AppletPanel.java:380)
at java.lang.Thread.run(Thread.java:595)
BUILD SUCCESSFUL (total time: 2 seconds)
11 years ago