Search Results

Search found 33640 results on 1346 pages for 'java generics'.

Page 141/1346 | < Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >

  • Detecting and handling third-party library filehandle leaks in Java

    - by tucuxi
    Is there any way to detect and handle whether a Java library is correctly releasing file-handles (via "close") from within a Java program that is using said library, short of having access to the actual library code and inserting the corresponding "finally close" statements? If detection is feasible, is there any way to close those file-handles without a reference to the Reader (or FileInputStream) that was reading the file?

    Read the article

  • Paste a multi-line Java String in Eclipse

    - by Thilo
    Unfortunately, Java has no syntax for multi-line string literals. No problem if the IDE makes it easy to work with constructs like String x = "CREATE TABLE TEST ( \n" + "A INTEGER NOT NULL PRIMARY KEY, \n" ... What is the fastest way to paste a multi-line String from the clipboard into Java source using Eclipse (in a way that it automagically creates code like the above).

    Read the article

  • LD_DEBUG and java

    - by solotim
    When I set LD_DEBUG=files and run my Java program, I found many errors like this: /linux/depot/java-1.6.0_16_32/jre/lib/i386/libjava.so: error: symbol lookup error: undefined symbol: Java_sun_java2d_loops_MaskBlit_MaskBlit (fatal) This info is horrifying, but obviously my program runs OK. Can anyone tell me why this happens?

    Read the article

  • java api design - NULL or Exception

    - by srini.venigalla
    Is it better to return a null value or throw an exception from an API method? Returning a null requires ugly null checks all over, and cause a major quality problem if the return is not checked. Throwing an exception forces the user to code for the faulty condition, but since Java exceptions bubble up and force the caller code to handle them, in general, using custom exceptions may be a bad idea (specifically in java). Any sound and practical advice?

    Read the article

  • calling a java servlet from javascript

    - by marco
    Hello, I am trying to create a web application using the MCV design pattern. For the gui part I would like to use javascript. And for the controller Java Servlets. Now I have never really worked with javascript, so I'm having a hard time figuring out how to call a java servlet from javascript and how to get the response from the servlet. Can anybody help me out?

    Read the article

  • How to create a windows service from java app

    - by ideasculptor
    I've just inherited a java application that needs to be installed as a service on XP and vista. It's been about 8 years since I've used windows in any form and I've never had to create a service, let alone from something like a java app (I've got a jar for the app and a single dependency jar - log4j). What is the magic necessary to make this run as a service? I've got the source, so code modifications, though preferably avoided, are possible.

    Read the article

  • Java accessing variables using extends

    - by delo
    So here I have two classes: Customer Order Class and Confirmation Class. I want to access the data stored in LastNameTextField (Customer Order Class) and set it as the text for UserLastNameLabel (Confirmation Class) after clicking a "Submit" button. For some reason however, the output displays nothing. Snippet of my code: package customer_order; public class customer_order extends Frame{ private static final long serialVersionUID = 1L; private JPanel jPanel = null; private JLabel LastNameLabel = null; protected JTextField LastNameTextField = null; private JButton SubmitButton = null; public String s; public customer_order() { super(); initialize(); } private void initialize() { this.setSize(729, 400); this.setTitle("Customer Order"); this.add(getJPanel(), BorderLayout.CENTER); } /** * This method initializes LastNameTextField * * @return javax.swing.JTextField */ public JTextField getLastNameTextField() { if (LastNameTextField == null) { LastNameTextField = new JTextField(); LastNameTextField.setBounds(new Rectangle(120, 100, 164, 28)); LastNameTextField.setName("LastNameTextField"); } return LastNameTextField; } /** * This method initializes SubmitButton * * @return javax.swing.JButton */ private JButton getSubmitButton() { if (SubmitButton == null) { SubmitButton = new JButton(); SubmitButton.setBounds(new Rectangle(501, 225, 96, 29)); SubmitButton.setName("SubmitButton"); SubmitButton.setText("Submit"); SubmitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent e) { System.out.println("actionPerformed()"); // TODO Auto-generated Event stub actionPerformed() //THE STRING I WANT s = LastNameTextField.getText(); java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new confirmation().setVisible(true); } }); } }); } return SubmitButton; } package customer_order; public class confirmation extends customer_order{ private static final long serialVersionUID = 1L; private JPanel jPanel = null; // @jve:decl-index=0:visual-constraint="58,9" private JLabel LastNameLabel = null; private JLabel UserLastNameLabel = null; // @jve:decl-index=0: /** * This method initializes frame * * @return java.awt.Frame */ public confirmation() { super(); initialize(); } private void initialize() { this.setSize(729, 400); this.setTitle("Confirmation"); this.add(getJPanel(), BorderLayout.CENTER); } /** * This method initializes jPanel * * @return javax.swing.JPanel */ private JPanel getJPanel() { if (jPanel == null) { UserLastNameLabel = new JLabel(); UserLastNameLabel.setBounds(new Rectangle(121, 60, 167, 26)); //THE PROBLEM? UserLastNameLabel.setText(s); } return jPanel; }

    Read the article

  • feeding input to a java process from a batch file

    - by YGL
    If I have a simple java program that processes lines of text from standard input, then I can run it with the following script: @Echo off java Test < file.txt pause exit The script redirects lines of input from a separate file. Is there a way that I can avoid having to use an extra file? Or is this the easiest way? Thanks.

    Read the article

  • Is there a java api to access bugzilla?

    - by Mauli
    Is there a (standalone!) java api which wraps the XML-RPC interface to bugzilla? I don't want to program my own api for it, and I can't actually find a library which does this (and only this). Update: I'm looking for something like this http://oss.dbc.dk/bugzproxy/ only written in Java

    Read the article

  • Plugin support for a Java swing App (like Eclipse)

    - by Sudar
    I need to add Plugin support to a Java Swing App (like in Eclipse). The Plugin should have the ability to add new Menu items and tab components to the swing app. I am looking for frameworks or libraries which support it. So far I have found Java Plugin Framework http://jpf.sourceforge.net/ and planning to use it. Are there any other better alternatives to it?

    Read the article

  • Put a java socket-like program in a cloud service

    - by user293030
    I developed a server side java program, basically is a relay server so I can easily pass NATs and firewalls. The program works, but now I need a cloud service to host it. Do you know where/how I can put a java socket-like program in the cloud? Obviously, I prefer a free service or at least a free service while I'm testing. Thank you!

    Read the article

  • Exception cause in Java ME

    - by Casebash
    In Java SE it is possible set the cause of an exception using initCause to avoid losing information about the error when catching and rethrowing an exception Is it possible to do the same in Java ME?

    Read the article

  • JSP to Bean to Java class Validation

    - by littlevahn
    I have a rather simple form in JSP that looks like this: <form action="response.jsp" method="POST"> <label>First Name:</label><input type="text" name="firstName" /><br> <label>Last Name:</label><input type="text" name="lastName" /><br> <label>Email:</label><input type="text" name="email" /><br> <label>Re-enter Email:</label><input type="text" name="emailRe" /><br> <label>Address:</label><input type="text" name="address" /><br> <label>Address 2:</label><input type="text" name="address2" /><br> <label>City:</label><input type="text" name="city" /><br> <label>Country:</label> <select name="country"> <option value="0">--Country--</option> <option value="1">United States</option> <option value="2">Canada</option> <option value="3">Mexico</option> </select><br> <label>Phone:</label><input type="text" name="phone" /><br> <label>Alt Phone:</label><input type="text" name="phoneAlt" /><br> <input type="submit" value="submit" /> </form> But when I try and access the value of the select box in my Java class I get null. Ive tried reading it in as a String and an Array of strings neither though seems to be grabbing the right value. The response.jsp looks like this: <%@ page language="java" %> <%@ page import="java.util.*" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%! %> <jsp:useBean id="formHandler" class="validation.RegHandler" scope="request"> <jsp:setProperty name="formHandler" property="*" /> </jsp:useBean> <% if (formHandler.validate()) { %> <jsp:forward page="success.jsp"/> <% } else { %> <jsp:forward page="retryReg.jsp"/> <% } %> I already have Java script validation in place but I wanted to make sure I covered validation and checking for non-JS users. The RegHandler just uses the name field to refer to the value in the form. Any Idea how I could access the select box's value?

    Read the article

  • Global variables in java

    - by zachary
    I want to make a class in java that is assessable to all other classes in my project. I created this in the default package and now it cannot be seen. What is the best way to do this in java?

    Read the article

  • Simple Java to XML example

    - by Tom Brito
    I've read a time ago about generate xml from Java using annotations, but I'm not finding a simple example now. If I want to make a xml file like: <x:element uid="asdf">value</x:element> from my java class: public class Element { private String uid = "asdf"; } Which annotations I should use to perform that? (I have a xml-schema, if this helps the generation)

    Read the article

  • Java return to position N in call stack.

    - by Finbarr
    Using the return keyword in Java code will return execution to the last piece of calling code in the call stack. If object foo calls baz.bar(), the return keyword in the bar method will continue code execution in foo. Let's say I have object foo that calls foofoo that calls foofoofoo in the above scenario, and foofoofoo calls baz.bar(). Is there anyway in Java to use the return keyword, or something else, so that the code in the bar method can return all the way back up to foo? (WITHOUT THROWING AN EXCEPTION)

    Read the article

  • Accept Cookies inside Java code ?

    - by yox
    Hi, I'm dealing with a HTTP sockets project, I have to send 2 HTTP GET requests from my java code like this : Request 1 : call page X Page X is setting a cookie. Request 2 : call to page Y as you see to access the content of page Y i cookie must be present... how to accept a cookie from java code please ?

    Read the article

  • Remote Computer Monitoring in Java....

    - by vs4vijay
    I have Assigned a Project on "Remote Computer Monitoring "...(To access Other PC like VNC) and i decided to do this in Java(Because of Platform Independency..)... and my java classes are goin on and we are at Threading.. so tell me where to start the project ???... What Should i Learn More...?? and is there any prebuild interfaces for this???... PS: i have to Access the Remote Machine Graphically Like TeamViewer and Do some filetransfer Stuff....

    Read the article

  • Java converting to Jython-Getting a class object within itself

    - by Bggreen
    I am attempting to convert Java code to Jython and am using the apache Log and LogFactory imports. I am attempting to emulate Foo.class in Jython The chunk of code is as follows: in Java import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class MyClass { private static final Log log = LogFactory.getLog(MyClass.class); public MyClass(Document dom) { //code } How can I emulate this same behavior of MyClass.class in Jython/Python?

    Read the article

  • Deleting locked files with Java?

    - by Marcus
    We have to delete some directories and their contents using Java running on Windows. I was worried about running into the directory files being locked. We could just invoke Unlocker to do the delete. Or is there a more Java centric way to handle this situation?

    Read the article

  • Approaching Java from a Ruby perspective

    - by Travis
    There are plenty of resources available to a Java developer for getting a jump-start into Ruby/Rails development. The reverse doesn't appear to be true. What resources would you suggest for getting up-to-date on the current state of java technologies? How about learning how to approach DRY (don't repeat yourself) without the use of metaprogramming? Or how to approach various scenarios where a ruby developer is used to passing in a function (proc/lambda/block) as an argument (callbacks, etc)?

    Read the article

< Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >