java.lang.class

(java.lang.String) cannot be applied to (java.lang.Object)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 00:20:47
问题 Ive a Listner class called TopicS Im trying to call it from a gui called readMessages When Im trying to run the class TopicS using the following method, private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { System.out.println("test test test"); System.out.print("you pressed" +topicCombobox.getSelectedItem()); TopicS a = new TopicS(); a.addTopicToListner(topicCombobox.getSelectedItem()); } It gives me error saying addTopicListner(java.lang.String) in Topics Cannot be applied

Does Class.newInstance() follow the “Abstract factory” design pattern?

廉价感情. 提交于 2019-12-05 01:59:53
I have started reading Joshua Bloch's "Effective Java" (second edition). While reading item 2 ( Consider a builder when faced with many constructor parameters ), there is a particular statement that the author makes w.r.t the Class.newInstance() method. Specifically, the author says that The traditional Abstract Factory implementation in Java has been the "Class" object, with the "newInstance" method playing the part of the "build" method. This part has me confused a little bit - my understanding of the Abstract factory design pattern is that it is used to represent a factory of factories. The

(java.lang.String) cannot be applied to (java.lang.Object)

和自甴很熟 提交于 2019-12-04 06:51:55
Ive a Listner class called TopicS Im trying to call it from a gui called readMessages When Im trying to run the class TopicS using the following method, private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { System.out.println("test test test"); System.out.print("you pressed" +topicCombobox.getSelectedItem()); TopicS a = new TopicS(); a.addTopicToListner(topicCombobox.getSelectedItem()); } It gives me error saying addTopicListner(java.lang.String) in Topics Cannot be applied to (java.lang.Object) When I change the String to Object I get other errors. The main method is included

XML worker using itext

柔情痞子 提交于 2019-12-04 05:24:55
问题 import java.io.FileOutputStream; import java.io.StringReader; import com.itextpdf.text.Document; import com.itextpdf.text.PageSize; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.tool.xml.XMLWorkerHelper; public class HtmlToPDF2 { // itextpdf-5.4.1.jar http://sourceforge.net/projects/itext/files/iText/ // xmlworker-5.4.1.jar http://sourceforge.net/projects/xmlworker/files/ public static void main(String[] args ) { try { Document document = new Document(PageSize.LETTER); PdfWriter

NetBeans IDE 7.2.1 cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath

我只是一个虾纸丫 提交于 2019-12-04 04:31:12
I need help with android project inside NetBeans. I Just opened project which is created in NetBeans and I have some issues with "cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath" This is sample of one my file which have issues: package Helpers; import PreglednikLogika.Clanak; import android.content.Context; The first line package Helpers; is underlined and produce "cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath" I am new with netbeans and I tried some fixes but not success. Can somebody

XML worker using itext

对着背影说爱祢 提交于 2019-12-02 07:25:29
import java.io.FileOutputStream; import java.io.StringReader; import com.itextpdf.text.Document; import com.itextpdf.text.PageSize; import com.itextpdf.text.pdf.PdfWriter; import com.itextpdf.tool.xml.XMLWorkerHelper; public class HtmlToPDF2 { // itextpdf-5.4.1.jar http://sourceforge.net/projects/itext/files/iText/ // xmlworker-5.4.1.jar http://sourceforge.net/projects/xmlworker/files/ public static void main(String[] args ) { try { Document document = new Document(PageSize.LETTER); PdfWriter pdfWriter = PdfWriter.getInstance (document, new FileOutputStream("C:/Users/Jason/Desktop/testpdf.pdf"

java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.NullPointerException: storage == null

核能气质少年 提交于 2019-11-29 01:21:41
* I am trying to add items to the list view dynamically. But, I am getting a run time exception.Please help. Is there a problem with the global variable "values"? I tried to debug by printing the logs and I am able to see the values stored in the variable * public class FriendsActivity extends ListFragment implements TabListener { private Fragment mFragment; private String[] values; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getActivity().setContentView(R.layout.activity_friends); } @SuppressWarnings("deprecation") public void