TabPane and Pagination controls. However, I would like to be able to create a vertical toolbar that controls page or tab display.
Is it possible to create a Pagination with no page control? Or is my guess of sizing the Pagination control so that the lower section is off of the displayed window, thus hiding the page info? Or, is it possible to create a TabPane with panels, but no tabs?
package TheWorldCup; import java.util.ArrayList; import java.util.*; public class WorldCup2014{ public static void main(String args[]){ ArrayList<String> WorldCupTeams = new ArrayList<>();
[Code] ....
What it is doing is printing the team name and all eight groups and showing the group is: team name under. I want it to print out the team name, put it into a group and print out the group. Once 4 teams in a group, close that group off, do this until all groups are filled. How can I do this?
I have created an application in SceneBuilder, and want to call a pop up (also created separately in scene builder) when a certain button is pressed. How?
Let's say, there is a simple Java application. It could either be a Swing or JavaFX or a plain Console application.
Then there are kind of X plugin jars which can be also on the classpath.
The main application (e.g. main.jar) scans the classpath for classes, which implement an plugin interface. For each found implementation it invokes some method on the interface.
The interesting part now is, that upon calling the interface method, some plugins may want to popup a JavaFX window.
And the problem is, that I can't just call Platform.runLater there, because of "java.lang.IllegalStateException: Toolkit not initialized".
And if I somehow manage to call Application.launch() (when? where?) in the plugin then there's the danger, that the second plugin gets "IllegalStateException: Application launch must not be called more than once"
I also don't want to call launch() in the main application, since it is not necessarily an JavaFX application.
Do I maybe need to start separate JVM in the plugin? Could it still communicate with the original JVM then (main.jar)?
I would like to ask how i can create a bidirectional folder copy system with SFTP JSch is there any example. Like i see the code can only transfer file, I need to transfer a folder with many files from my pc to a server and the opposite.
I'm now working more and more on the go and although I can carry my Macbook Air without too much trouble I've just been given an iPad Mini by work and it's far easier to do what I do with that on the move.
For work I need to open around 35 different websites at one time 4/5 times a day on the move.
With my Macbook that's no issue, as I can just use the open all function of my bookmarks, but on the iPad there is nothing that will allow me to do this.
I have looked online and a few people have had this issue and fixed it using the below Java method:
Creating a link that when clicked sets off a Javascript function that contains several window.open("url"); Clicking the link opens each website in its own tab.
I am creating a simple code in Java that replaces all tabs the user inputs with '*'. However, I am doing something wrong and I am not sure what. Here is what I have so far in Eclipse..
import java.util.Scanner; public class ReplacingTabs { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = ""; String s2 = "";
[Code] .....
There is an error with the s2 in the line String s2 = s.replace(' ','*');
I think I need to add String s2 to the loop but I am not sure how..
Displaying the records in a table. I am looking for a group header to be placed above each printed table for its related category and subcategory, as well as, the no. of the records for each table to be shown at the top of the table.
The table contains columns for category, subcategory, name. ex:
Category Subcategory Name
CON Retail AAA
CON Wholesale BBB
SPEC Retail CCC
What I am looking for is the below layout:
Category/Subcategory (No. of records) –similar to a group header
Name – Country ..etc ----Table header
table records
Here is my code below:
<% //Retrieve the values from the DB while (rs.next()) { category_name1=rs.getString("category_name"); subcategory_name1=rs.getString("subcategory_name");
[code]....
The problem in the above code is that it is showing the group headers category & sub category multiple times and the count is incorrect.
import java.util.Scanner; public class AvgLrgSml{ public static void main(String[]args){ System.out.print("Hello there. Please enter any three numbers."); Scanner keyboard = new Scanner(System.in); double num1 = keyboard.nextDouble(); double num2 = keyboard.nextDouble();
How do you make it so that you can select 2 buttons in a radio button group? for example: If I have 7 radio buttons, and I want to be able to select 2 of the 7 instead of 1.
I am making a tile based top-down 2D RPG and am using Box2D for the physics. Since my game is tile-based, there are many tiles on each map that cannot be moved through. This results in many small individual Box2D bodies. This is obviously very inefficient and makes the game lag. Therefore I figured that combining the individual tiles' bodies into larger complex groups would be better.
The way I thought of doing it is to, first, group together tiles into groups of tiles that all share 2 vertices with at least one other tile in the group. Then, for each group I do the following. First I get all of the uncommon vertices (these should be the ones on the outside of the polygon). Then I connect all of those vertices and then remove all of the overlapping lines. This should result in only lines on the outside of the polygon. Then I sort the lines so that the first line in the sorted array shares its end point with the second line's start point, etc. Then I remove the doubled vertices and using those remaining vertices (I called them the "true vertices") I create the polygon. I know that Box2D only supports convex polygons, but with Box2DSeparator I should be able to do this, but I first want this method to actually work.
/** * Attempts to combine the given blocks into larger bodies to improve performance. * @param bs The created wall blocks. * @param w The world. Used for body creation. */ private void makeLargeBodies(Block[][] bs, World w) { Array<Tile> tiles = new Array<Tile>(); for(int i = 0; i < bs.length; i++) {
[Code] .....
However, this is where the first problem arises. This method is extremely slow for large maps (like 200x200 tiles). I have worked at this for very long and right now my head can't figure out how to make the loop more efficient...
Now for the next part. After that I attempt to create the bodies for the TileGroups:
//create all the groups' bodies size = groups.size; System.out.println(size + " groups"); for(int i = 0; i < size; i++) { TileGroup g = groups.get(i); System.out.println("Starting group " + i + "."); long timeCheck = TimeUtils.millis(); g.createBody(w); System.out.println("Group 0 took " + (TimeUtils.millis() - timeCheck) + " millis"); }
*Note that the printing is for debugging purposes*...
This method is probably not a problem; it is what is inside createBody(World) that is the issue...
public void createBody(World w) { Array<Vector2> allVertices = new Array<Vector2>(); Array<Vector2> uncommonVertices = new Array<Vector2>(); System.out.print("Starting search for uncommon vertices. "); long timeCheck = TimeUtils.millis();
[Code] .....
Most of the code is self-explanatory (with comments). My current issue is where I connect the uncommon vertices (see the printed statements). This method does not actually finish (I have let it run for several minutes and it does not complete). This is likely due to a large number of vertices (often around 3000 in a 60x60 map), but I cannot figure out how to make the loop more efficient... Because of this early failure I don't know if the rest of the method works, both physically and in theory.
All relevant classes (Tile, TileGroup, Line) are below:
private class Tile { private Vector2[] vertices; private TileGroup group; public Tile(int x, int y) { vertices = new Vector2[4];
I am making an expert system using Jess about animals. I wanted to make an interface using Swing and so I did. I have a problem using group layouts. The application works fine but at the end a exceptions is thrown:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: javax.swing.JLabel[,0,0,0x0,invalid,alignmentX=0.0, alignmentY=0.0,border=,flags=8388608,maximumSize=,minimumSize=, preferredSize=,defaultIcon=,disabledIcon=,horizontalAlignment=LEADING, horizontalTextPosition=TRAILING,iconTextGap=4,labelFor=, text=The animal is a cheetah.,verticalAlignment=CENTER, verticalTextPosition=CENTER] is not attached to a horizontal group
[Code] ....
The application ask the user some questions about the animal. When the expert system has enough information to know the animal it tells the name of the animal and shows a picture of it. The exception is thrown when the application has guessed the animal and shows the response.
So the user is on a website and I want them to go to another site using the same browser and tab.Can this be done in java? And yes the java program is running on the browser .
I have to organize the rows from the lower to the higher number, the problem is, what I have only organizes the first 3 rows even If I insert 3,4,5...or 10 rows.
for (int i = arg[0].length - 1; i >= 0; i--) { for (int j = 0; j < i ; j++) { for (int k = 0; k < i ; k++) { if (arg[k][j] > arg[k][j + 1]) { int temp = arg[k][j];
I have an ecommerce site that has about 100000 SKUs. What is the best practice for handling all the product images as far as where to store them and how to display them on the pages? Should I have a separate HTTP server to serve the images?
I need fixing an issue in the search textbox in one of the jsp's. I was informed that cross site scripting can be done in the textbox and I kept the below code in my jsp to fix the issue:
Now, after applying the above code, the cross site scripting can be done and the problem is that the search can't be done using the textbox and all the time will display none results.
I'm looking for a way to gather data from a site page. all data is shown in the same page... I am trying to get the content and parse it is a bit crazy as data seems to be not organized. Itried to get it as a document but still looks crazy.
As all data is shown very clearly in the page (I would like every row to be an object) I'm sure there is some way to collect this data easily. (the data is from this page: [URL] ....)
I'll attach a snapshot and the content I got from the website.
fixing an issue in the search textbox in one of the jsp's. I was informed that cross site scripting can be done in the textbox and I kept the below code in my jsp to fix the issue:
Now, after applying the above code, the cross site scripting can be done and the problem is that the search can't be done using the textbox and all the time will display none results.
I am running a page that launches a Java Webstart app and a Java Applet. I don't have problem launching this page in Firefox, but I have to run it in IE11. The thing is IE11 keep redirecting me to oracle java download site. I have install Java RE like 3 times from IE already. What am I missing?