I change TreeTableColumn.text but I got a Exception
Exception in thread "JavaFX Application Thread" java.lang.ClassCastException:
javafx.scene.control.TreeTableColumn cannot be cast to javafx.scene.control.TableColumn
at com.sun.javafx.scene.control.skin.TableHeaderRow$10.invalidated(TableHeaderRow.java:277)
so I check TableHeaderRow . I find this method
private final InvalidationListener columnTextListener = new InvalidationListener() {
@Override public void invalidated(Observable observable) {
TableColumn<?,?> column = (TableColumn<?,?>) ((StringProperty)observable).getBean();
CheckMenuItem menuItem = columnMenuItems.get(column);
if (menuItem != null) {
menuItem.setText(getText(column.getText(), column));
}
}
};
I can't recolate and align the button, the circle or the line where i want it to on the canvas. I want to be able to move the line where i want it, now it seems like all objects are stuck in the middle of the scene or canvas.
I have a list of Row objects and want to listen to changes in the name property of a Row object.
public class Row implements Serializable { private final SimpleStringProperty name = new SimpleStringProperty(this, "name", ""); public Row() { this(""); } public Row(String name) { this.name.set(name);
[Code] ....
I would expect to be notified 4 times. Line 23: Added, Line25, 26, 27: Update
But there are only 2 change events. For Line 26 and 27 there is no change event.
We have developed a theme called default.css that is extending of the default caspian.css. What we want to do is offer users the ability to override values from default.css to change colors etc. How can that be done?
I am using javafx 2 in my project,After user change the text in HTMLEditor,i will save the context to database,if text wasn't changed,then i do nothing .so i want to know if the user have changed the text.
I only saw how to add text changed listener to HTML web viewer. So how to add text changed listener to htmleditor?
I have a table column and I want to change the columns header justification from center justified to left justified. How do I do this, either via code or via CSS.
is possibile to change the color of the sorting arrow that appears in the columns of the Table View by css? My attempts have failed and I have not found any documentation, nor is there any reference in the Modena css.
I have noticed a strange behavior of Combobox element. The number of visible rows is not the same established by setVisibleRowCount() method. It happens when changing the items list dynamically. The following example reproduces it. I think it is Javafx 8 bug. I have tried unsuccessfully to trigger some event indirectly to refresh the combobox drop down.
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class TestComboBox extends Application { private int count;
So it seems to reason that many JavaFX applications will want to dynamically change CSS styles. Is the best way to do this via the <node>.getStyleClass().add("classname")? The underlying data structure is an observable list. So lets say one has 5 styles that simply change the fill color of a circle to 5 different colors respectively. So if I have a condition in which I want to dynamically apply 1 of these 5 styles, the way I currently do this is by defining all 5 styles as strings in a list using a static initializer, then I call <node>.getStyleClass().removeAll(list), then getStyleClass().add("classname"). I do this to avoid adding the same style over and over and inflating the underlying list. Is this the correct way to manage dynamic CSS styles?
So I know there is a few different way to implement a splash screen. My app has definitely gotten larger over the last few months of development and I have noticed there is about a 5 second delay between when I run the application to when I see the main stage. I was thinking a splash screen would be nice to fill this time period. I have not had time to prototype using a Preloader and I fear that using an alternate, lightweight stage on startup would still take too long of a delay. I was actually thinking that using the nice and simple JVM argument "-splash:<image name>" would be simple, easy and effective. Unfortunately when I try to do this, the splash screen comes up but never goes away.
I am very new to Java Swing. I have to create a TreeTable in Java Swing with a Parent Row having say 6 columns and its all child row having just 4 columns. like shown below
I have developed a java GUI project. I put wrong name for my project. after some time i found it and then correct by right clicking and click rename tab.
Now i run my gui it shows old project name in title. i didnt get my new project name.. how can i change it to new name
I have a TabView that generates the numbers of tabs, titles and content based off of the selected project from another field. I have managed to get it to load the proper number of tabs and content, but the first tab title displays the title of the first tab from the previous query.
And the method handling the content and number of tabs:
public DatabaseViewHandler() { deviceTypes = new LinkedHashMap(); } public Map<String, String> getDeviceTypes() { return this.deviceTypes;
[Code] ....
The method findAssociatedEquipment() is called when it recieves a selected project to display.
The command button calls the update for panelGroup "equipmentWrapper". It updates fine for the ui:include and generates the correct number of tabs in the correct order.
So for example the first query might only generate one tab for an 881 device. Then if you select a project that should have a 2911 and 2960 it will correctly load both, but the title for the first tab will retain 881. Should you select a third it will have the title 2911 from the second project.
i want to check my array for a title, if the title is there i want to call a method, if the title is not there i want an error message. I am not sure how to get this. i think my code would work if it didn't always finish the method. for example if true the method stops and does run whats after the for loop. but that isn't happening.
void markItemOnLoan(String title, String name, String date){ int i=0; for (i = 0; i < numberOfItems; i++){ if (items[i].getTitle().equals(title)){ items[i].markOnLoan(name,date); } } System.out.println("ERROR: Can not find that item. "); }
I developed a simple java gui . On running a frame opens with 5 buttons and each button opens another frame when selected. There are no errors and frames open and close as required however i see that only the main program frame has the icon and title that i assigned and the frames bieng called through the buttons have the default frame with java icon and no title although it's been specified in the code of these called frames. When these called frames are executed individually though the program the title and icon are displayed.
I am familiar with php, but I don't know Java. We need a program, that will be able to scrape large amount of title tags from large sites, fast. I've been trying Seo Spider by Screaming Frog, and Xenu's Link Sleuth, but these programs are not good enough. They hang up, they save all the data in RAM, I think, and after a relatively short period of scraping, they stop working, become unresponsive, and so on.
Somebody recommended me getting a custom made program in Java, which would be able to scrape title tags only, from large sites (I am talking 25 - 50 million pages or more). I was told that it would not have a graphic interface, or anything like that. Nothing like this is needed too, we just need to have title tags.
In a text file, I have individual titles (starting with ">" character), and under those titles, I have calculated values for a Counter. I want to search the entire text file for the highest counter under every title. After I get the highest counter, I would like to print it's title, name of the counter, and counter value. Example of the code I already have:
int letterCounter; String line; if (line.startsWith (">")) { bw.write (""); bw.write (line); } else { //code that counts how many total letters (letterCounter) under title }
I am currently making a video player which allows users to open/play videos which are stored on their computer. I am using JavaFX for this.My problem, is that sometimes when I click the button to load a video, a java.util.ConcurrentModificationException is raised. Other times, it's perfectly fine.I put the calls to .loadAndPlayMediaA() and .prepareMedia() (see below) inside a .runLater(Runnable) to try to prevent this, but it has not worked. My Code (below) is called by a listener on a button, "testButton". I have a class called JfxMediaPlayer which holds the method loadAndPlayMediaA(), and a class called MixingDeck which holds the method prepareMedia()
I have a strange problems. Perhaps some of you already have had this problem before.
I have method which is suppose to check if the itemstate has changed. It ONLY works ONCE?
Thereafter, it does not matter how many times I changed the selection of the ComboBox.
Basically I have two Comboboxes.
1. If Combobox 1 is selected (e.g. Dogs, Cats) 2. Then get information from what ever the item from ComboBox 1 is selected, and display on ComboBox 2. (Dog Name, Cat Name etc)
E.g.
So If I selected Dogs on Combobox 1 Then display the Dog Names on Combobox 2. If I then change and select Cats on Combobox 1, then display Cat Names on ComboBox 2.
I need to change the program below to an "array"....
public class RecursiveFibonacci { public int fibonacci(int n) { int result; if (n == 1 || n == 2) result = 1; else { int n1 = fibonacci(n-1); int n2 = fibonacci(n-2);
Write a program that asks the user for the low and high integer in a range of integers. The program then asks the user for integers to be added up. The program computes two sums:
The sum of integers that are in the range (inclusive), and the sum of integers that are outside of the range. The user signals the end of input with a 0.
Your output should look like this:
Sample input/output
In-range Adder Low end of range: 20 High end of range: 50 Enter data: 21 Enter data: 60 Enter data: 49 Enter data: 30 Enter data: 91 Enter data: 0 Sum of in range values: 100 Sum of out of range values: 151
This is my assignment and below is my code.
import java.util.Scanner; class InRangeAdder { public static void main(String[] args) { Scanner scan = new Scanner (System.in); int low, high, data=1, rangesum=0, outrangesum=0;
[Code] ....
The problem is that the program simply gives an output of 0 for both "rangesum" and "outrangesum". I don't quite understand why that is. Also i have a quick question, the program needs me to end the program when the value of data is 0 but in order to initialize it I need to give it a value. Usually I would give it a value of 0 like I have for rangesum and outrangesum but if I do the program does not run till the loop as it considers the value of data to be 0 and ends the program right away. What would be a work around to this and when do I need to have a value to initialize an integer? for example, I do not need a value for low and high. Is this because the program recognizes that a value is going to be defined but cannot do that for the other integers as they are inside a loop?
I am very much new to Java. I have just started learning event handling. Currently I am learning about Key Events. And am learning by doing. Well that is how one could learn anything in fact. I want to write a program in which the currently loaded image in the panel of a frame changes upon a key press say "Enter" or any other key.
I'm programming in school using Netbeans and we've just started with graphical programming (i.e JPanel, JClass, JFrame). This is my first assignment and the purpose of this program is that when you press the mouse you will fill 4 circles with diffrent colors. I've managed to draw 4 circles with diffrent colors but I want my cursor to change color simultaneously. Here's my code so far ....
//Java klass "Klick" public class Klick { //Medlemsvariabler. private int x = 0; private int y = 0; private int r = 1; public int antal = Rityta.antalKlick;