Skip to content
Advertisement

How do I instantiate a Queue object in java?

When I try: The compiler is giving me an error. Any help? Also, if I want to initialize a queue do I have to implement the methods of the queue? Answer A Queue is an interface, which means you cannot construct a Queue directly. The best option is to construct off a class that already implements the Queue interface, like

Dynamically change JComboBox

I am fetching the data values from the database successfully. I have also stored them into a String[] array. I need to load the String array as the items of the JComboBox in response to key actionperformed. How can I reload the items of the JComboBox whenever a key is pressed as the fetched values depend on the key pressed.

Is there any real alternative to GeoServer as dynamic map generator in Java?

I’m looking for the most suitable tool for generating dynamic geographical maps in Java (with styles based on custom business data: colors, labels etc. will be dynamically set). After some searching, only GeoServer (and the underlying GeoTools library) seems to fit. Although I’m really happy with this solution, I’m afraid I might miss something and make some decision based on

how to accept self-signed certificates for JNDI/LDAP connections?

I need to connect to an LDAP directory over SSL. In non-production environments, we use self-signed certificates which, of course, fails to validate with: I am aware of how to use a custom trust manager for SSL-enabled connections, but don’t know how to use one in connection with the JNDI API where I don’t manage the actual connection. That is,

Parsing an arithmetic expression and building a tree from it in Java

I needed some help with creating custom trees given an arithmetic expression. Say, for example, you input this arithmetic expression: The result tree should look like: I have some custom classes to represent the different types of nodes, i.e. PlusOp, LeafInt, etc. I don’t need to evaluate the expression, just create the tree, so I can perform other functions on

NoAspectBoundException with aspectj and tapestry 5

I have a web project built with Tapestry 5.2.1. I have a simple logging aspect that I was using for tracing on this application. Everything was working fine until I started refactoring parts of the application and attempted to deploy it. When I deploy the application, no matter what page I attempt to go to I get the following exception:

Read next word in java

I have a text file that has following content: I read the text file and iterate through the lines: Each line has two words. Is there any method in java to get the next word or do I have to split the line string to get the words? Answer You do not necessarily have to split the line because java.util.Scanner’s

Advertisement