Search Results

Search found 15 results on 1 pages for 'albinoswordfish'.

Page 1/1 | 1 

  • Strange Integer.parseInt exception

    - by Albinoswordfish
    Exception in thread "Thread-2" java.lang.NumberFormatException: For input string: "3" int test = Integer.parseInt(result[0]); This is the error I keep getting when I'm trying to convert "3" to an integer. Well I'm receiving this "3" through a RS-232 port, so maybe this is what is causing the error. If anybody has any idea what could be causing this it would be appreciated.

    Read the article

  • LF/CR issue with RS232 in Linux

    - by Albinoswordfish
    I've been having this problem where anytime I send a 0xA through an RS-232 in a Linux OS the receiver interprets that as 2 bytes, 0xD and 0xA. Also whenever I receive 0xD the serial port interprets that as 0xA. I've been reading that there are known issues regarding this, has anybody been able to find a solution?

    Read the article

  • Java focus question

    - by Albinoswordfish
    This may be a silly question I don't know. Is there a way to remove the highlighter to represent focus in a Java GUI? For example when you click on a button the text will have a slight rectangle around the text. Thank you

    Read the article

  • File I/O OS handling

    - by Albinoswordfish
    This isn't a direct coding question but more of a OS handling mechanism. I was reading somebody's previous question regarding C# and file handling. Apparently C# was throwing an exception regarding a file being locked when trying to access this. So my question is, does C# use an internal lock to handle file I/O between processes, or does the OS use some type of mutual exclusion for file I/O? From what I learned about operating systems, well at least unix, is that the OS doesn't implement any type of mutual exclusion for processes trying to access the same file.

    Read the article

  • Creating a java library

    - by Albinoswordfish
    This may be a silly question, but right now I have a rather large class that I want to use as a library. Where somebody can simply add this jar file to their classpath. And then simply do an import statement at the top, then he or she can start using this class. Is there anything special I need to do or can I simply just use the jar file built?

    Read the article

  • Setup a https client in Java

    - by Albinoswordfish
    I'm very new to HTTPS/SSL so excuse my lack of knowledge. Right now I'm trying to setup a simple Java client in which it connects to a web server through HTTPS. I've seen some example code online but can't seem to really make sense of it. Also I was wondering if there is a difference between setting it up on a Windows machine compared to another type of OS. If anybody knows a good tutorial on this or can head me towards the right direction it would be appreciated.

    Read the article

  • GridLayout with single column

    - by Albinoswordfish
    Right now I'm trying to use a GridLayout with only a single column. However I'm having a problem where I don't want the object, in this case a JButton, to be stretched the entire width of the JPanel that it's on. Is there a way to decrease the width of the JButton so that it does not stretch the entire width of the JPanel. I've tried using setPreferredSize and setSize with no results. Is this just the way GridLayout works or is there something I'm missing?

    Read the article

  • Dynamic graphing using Jfreechart

    - by Albinoswordfish
    Right now I'm using JFreeChart in order to create a dynamic chart. However the chart is significantly slowing down my GUI. I was just wondering, is jfreechart generally heavy in the graphics department (my computer is not fast at all). Or is there a way to configure the ChartPanel to better optimize dynamic charting.

    Read the article

  • Visual Editor vs Manual code

    - by Albinoswordfish
    I'm not sure how it is using other frameworks but this questions is strictly regarding Java swing. Is it better to use a Visual Editor to place objects or to manually code the placement of the objects onto the frame (Layout managers or null layouts)? From my experience I've had a lot of trouble using Visual editors when it comes to different screen resolutions or changing the window size. Using manual code to place objects I've found that my GUIs behave a lot better with regard to the screen size issue. However when I want to change a small part of my GUI it takes a lot more work compared to using a visual editor Just wondering what people's thoughts were on this?

    Read the article

  • Double paging definition

    - by Albinoswordfish
    This is not a programming question but more of an operating system question Right now I'm trying to learn what exactly Double paging means. I see two different terms, double paging on disk and double paging in memory. Apparently this problem arises when we introduce a buffer cache to store disk blocks when doing File I/O But I'm not really sure what exactly this term means. If anybody could specify it would be very helpful.

    Read the article

  • Set Caret position with JTextArea in JScrollPane

    - by Albinoswordfish
    Right now I have a JTextArea inside of a JScrollPane. For the current content it has both a vertical and horizontal scroll bar showing up. I'm trying to implement a search functionality where a user can search for a certain string and it will set the caret position to the first occurrence of that string. However it seems that JScrollPane only scrolls vertically when I set my caret position. So matching strings going off the JTextArea horizontally will completely get missed and the horizontal scroll bar won't scroll at all. I'm using the basic function setCaretPosition() for the JTextArea Does anybody have any idea why my JScrollPane isn't moving horizontally using setCaretPosition() Edit: It appears the horizontal scroll bar is scrolling but it moves so little that it's barely noticeable. I can only see the very first pixel of the character. Is there a way to have the scrollbar center (or as much as possible) to the caret position?

    Read the article

  • Spring + Hibernate + JPA

    - by Albinoswordfish
    As of now I have a working Spring application with persistence. However now I want to use Hibernate with JPA to do all of my database activities. I want to do this using an entitymanager. I've been reading many documents and tutorials on this matter, I've been getting confused on whether I need a persistence.xml file or not. Also I've been getting confused on how to setup my applicationContext.xml file as well. Does anybody know of a good site to look at in order to learn Spring + Hibernate + JPA + using EntityManager?

    Read the article

  • Another Spring + Hibernate + JPA question

    - by Albinoswordfish
    I'm still struggling with changing my Spring Application to use Hibernate with JPA to do database activities. Well apparently from a previous post I need an persistence.xml file. However do I need to make changes to my current DAO class? public class JdbcProductDao extends Dao implements ProductDao { /** Logger for this class and subclasses */ protected final Log logger = LogFactory.getLog(getClass()); public List<Product> getProductList() { logger.info("Getting products!"); List<Product> products = getSimpleJdbcTemplate().query( "select id, description, price from products", new ProductMapper()); return products; } public void saveProduct(Product prod) { logger.info("Saving product: " + prod.getDescription()); int count = getSimpleJdbcTemplate().update( "update products set description = :description, price = :price where id = :id", new MapSqlParameterSource().addValue("description", prod.getDescription()) .addValue("price", prod.getPrice()) .addValue("id", prod.getId())); logger.info("Rows affected: " + count); } private static class ProductMapper implements ParameterizedRowMapper<Product> { public Product mapRow(ResultSet rs, int rowNum) throws SQLException { Product prod = new Product(); prod.setId(rs.getInt("id")); prod.setDescription(rs.getString("description")); prod.setPrice(new Double(rs.getDouble("price"))); return prod; } } } Also my Product.Java is below public class Product implements Serializable { private int id; private String description; private Double price; public void setId(int i) { id = i; } public int getId() { return id; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Double getPrice() { return price; } public void setPrice(Double price) { this.price = price; } public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("Description: " + description + ";"); buffer.append("Price: " + price); return buffer.toString(); } } I guess my question would be, How would my current classes change after using Hibernate + JPA with an Entity Manager

    Read the article

  • XML parsing problem

    - by Albinoswordfish
    I'm having this strange XML parsing problem. I have this XML string I'm trying to parse <?xml version="1.0"?> <response status="success"> <lot>32342</lot> </response> I'm using XPath with Java in order to do this. I'm using the Xpath expression "/response/@status" to find the text "success". However whenever I evaluate this expression I get an empty string. However I am able to successfully parse this string using "/response/@type" <?xml version="1.0"?> <response type="success"> <lot>32342</lot> </response> So why would simply changing the name of the attribute change the return string to nothing? is = new InputSource(testWOcreateStrGood); xPathexpressionSuccess = xPath.compile("/response/@status"); responseStr = xPathexpressionSuccess.evaluate(is); reponseStr is the string I posted earlier with the "status" attribute

    Read the article

1