Very poor info. Lots of glitch : 1. What happen if Connection return as null. 2. What happen if ResultSet return as null. 3. Finally if all run good, then where is the code to close the resources.
Regards Shubhashish
Very poor info. Lots of glitch : 1. What happen if Connection return as null. 2. What happen if ResultSet return as null. 3. Finally if all run good, then where is the code to close the resources.
Regards Shubhashish
To add anything in scrollPane , try this
jscrollpane.setViewPortView(...)
Regards Shubhashish
I didn't see any layout set against the JPanel jP1. see this http://docs.oracle.com/javase/7/docs/api/java/awt/BorderLayout.html[^]
Regards Shubhashish
few things that you have to know. Role of the Observer is to notify each subscriber if any changes happen. If you see in your code there is a recursive call exist. In your main class , at the end, you are setting value in Observer. So Observer value changed and it convey the notify message to the subscriber.Again If you see in doAction() ,you can see that each Subscriber receive the notify message and again set the Observer value with new one. There for this action again update the Observer value and again Observer doing the above thing and thus fall in recursive call.
Regards Shubhashish
Please update the code with your changes. May be there are some memory leak. This may help you http://www.java2s.com/Code/Java/Design-Pattern/AsimpledemoofObservableandObserver.htm[^]
Regards Shubhashish
I think you failed to understand the publisher-subscriber framework. Publisher has many subscriber .i.e one to many relation ship with subscriber.Publisher post the new event(if any), and all the subscriber which have the subscription, will catch the event. So this is pretty much concept. In java , publisher as Observable and subscriber as Observer. Now, in your app you create an Observable (CValue). Then you create Observer which is again an Observable(CData extends Observable) and register this with the Observable, means you register an Observable with another Observable. So fixed this things before moving forward
Regards Shubhashish
you may try this http://www.activetree.com/jreport/docs/smartjreport_tutorial.html#can_i_automatically_print_or_pdf[^]
Regards Shubhashish
TextArea does not support any html content. You can use a JEditorPane to display HTML or a JTextPane,
Regards Shubhashish
I guess you want something like user hit count of any web site. If yes then you have think about the init()
of the servlet . Because its only executed when the servlet is called for the first time.So if you define a variable inside this block , and increment that value in processRequest()
, you will get the hit count.
Regards Shubhashish
Currently JMF support the several format. Check this http://www.oracle.com/technetwork/java/javase/formats-138492.html[^]
Regards Shubhashish
welcome :-D
Regards Shubhashish
Cross post.
Regards Shubhashish
You can only register an event handler to an event source. So your first class is an event handler. And there fore you can use this to any of the event source which trigger that event. Something like this.
class Handler implements ActionPerformed{
public void actionPerformed(ActionEvent e) {}
}
}
class Source {
p s v main(){
JButton bt = new Jbutton("Ok");
bt.addActionListener(new Handler());
}
}
Regards Shubhashish
The problem is here. Your ResultSet return one row. First rs.next()
point to the actual row returned. Again in while loop you use rs.next()
so your resultSet move to the next row, and which has no row value(first row already read) so it return false and thus skip the while loop.
System.out.println("sssssssssssssssss" + rs.next());
while(rs.next()) {
Remove the sout.
<pre lang="java">
while(rs.next()) {
</pre>
Regards Shubhashish
"TorstenH" want to say you that you have to check the "index" value before using it to set the selected item. You should check "index" value whether it is in the range of your image list size.
Regards Shubhashish
As "Rechard" suggest, add KeyListener
to your imageList
and put your logic on KeyPress event to move the next item on the list on up/down arrow key.
Regards Shubhashish
This is a common error. Its told you that classes ,you have used in your application, not in project classpath. So make sure that you have add the location of your .class file to your classpath.
Regards Shubhashish
You should read this. This might help you to understand how "tld" works.
Regards Shubhashish
styleId
is similar as id
in normal HTML, to uniquely identified the element
Regards Shubhashish
This should come at the end
frm.setSize(300,300);
frm.setVisible(true);
Regards Shubhashish