craig peddie

Greenhorn
+ Follow
since May 15, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by craig peddie

I have built a javafx app that consists of two screens, one for information about the speaker, and then the second prompts the user to record phrases. Everything works fine when I run it in eclipse, but when I try and run it as a jar or standalone nothing works. Comes up fine with the initial screen, all the validity checks work fine on the fields, but when I press the button that should take to the next screen it either bombs on a null pointer trying to load the fxml for the next screen (running generated jar directly) or just doesn't do anything (if running from dmg). All the ant build seems to be set up correctlywith the files and resources, but it seems that the jar output is not include all the resources. Is there a simple step I'm missing to create and output jar correctly for JavarFX?
9 years ago
Hi

I'm writing a small utility in JavaFX to capture audio from a microphone. The first recording captures fine, but then when I start to capture the 2nd recording, the system hangs at targetDataLine.read(). The UI thread sets the recording flag to true/false. Recording code is below:



I can't for the life of me figure out why it hangs the second time. Am I not closing some object that I should be? The second time in we go thru the reading from targetDataLine loop 9 times before we hang. Does the same thing every time.

Does anyone have any ideas?

Thanks.....
9 years ago
No stack trace was available since no console output at all made it to the screen. Traced all the way to the error and it was happening in FileOutputStream.write(). Reinstalled JRE and now everything is working fine. Must have a been a bit error somewhere in the download or install.....probably due to sunspots.
9 years ago
I have just downloaded jdk8 to start playing with javafx. Before I even trying any real javafx, I can't even get system.out.println to work. Any time I call it, it returns a null pointer exception. Even the simple hello world below bombs when you press the button to output the string:



Any ideas on how to fix this? Download and re-install java?

Thanks.....
9 years ago
Took about a day of searching, but found that I needed the following packages installed to make everything work:

dirac-libs-1.0.2-9.fc18.i686.rpm
libavcodec52-0.7.15-32.fc18.i686.rpm
libavformat52-0.7.15-32.fc18.i686.rpm
libavutil50-0.7.15-32.fc18.i686.rpm
libxavs1-0.1.51-2.fc18.i686.rpm

Once these were installed, everything worked like a charm.
10 years ago
I'm developing what I thought should ahve been a simple task with javafx- media player that will play mp3 files stored on the local hard drive, in users default music folder path (using fedora). I can play all the mp3 files fine from the command line, but when I try and play via javafx.scene.media libraries, javafx keeps telling me that mp3 is an unsupported media type. I've downloaded about every library I could find, but to no avail. Here is a the code that actually tries to open the file and play the media:

First attempt:


MediaPlayer mediaPlayer = new MediaPlayer(audioFileStream);
mediaPlayer.play();
}
Method 2:



Both produce the exact same error result, shown here:



going to play file:/home/cpeddie/workspace/parnassusfx/07-Basket-Case.mp3
Exception in thread "JavaFX Application Thread" MediaException: MEDIA_UNSUPPORTED : com.sun.media.jfxmedia.MediaException: "Error media audio format unsupported" : com.sun.media.jfxmedia.MediaException: "Error media audio format unsupported"
at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:125)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:474)
at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:383)
at com.promptu.parnassusfx.sample.music.MusicController.playTrack(MusicController.java:218)
at com.promptu.parnassusfx.sample.music.MusicController$3$1$1.handle(MusicController.java:357)
at com.promptu.parnassusfx.sample.music.MusicController$3$1$1.handle(MusicController.java:1)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Node.fireEvent(Node.java:6867)
at javafx.scene.control.Button.fire(Button.java:179)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3311)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3151)
at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
at com.sun.glass.ui.View.handleMouseEvent(View.java:530)
at com.sun.glass.ui.View.notifyMouse(View.java:924)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:89)
at java.lang.Thread.run(Thread.java:724)
Caused by: com.sun.media.jfxmedia.MediaException: "Error media audio format unsupported"
at com.sun.media.jfxmediaimpl.MediaUtils.nativeError(MediaUtils.java:331)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMedia.init(GSTMedia.java:50)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMedia.<init>(GSTMedia.java:33)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTMediaPlayer.<init>(GSTMediaPlayer.java:39)
at com.sun.media.jfxmediaimpl.platform.gstreamer.GSTPlatform.prerollMediaPlayer(GSTPlatform.java:100)
at com.sun.media.jfxmediaimpl.platform.PlatformManager.createMediaPlayer(PlatformManager.java:173)
at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:260)
at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:139)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:431)
... 75 more

I should also mention that I'm developing this using VMWare fusion running on a MacBook Pro with OS 10.8.5. Running Fedora 19.

Any help will be appreciated!

10 years ago
Hi,

I'm trying to write a javafx based app that is gonig to display a list of music tracks in a tableview that will show the album cover art in the first column, artist name and track title in the middle column and then a play button in the third column. All the relevant file info is contained in an xml file that is read at runtime. So far, the code displays the table, reads the xml file and parses the data correctly and displayed the xml file path strings in the table entries. Now I am actually trying to have ti display the cover art image in the first column instead of the file path. I have spent a couple of days looking at various implementations of this general idea all over the web, but when I try and implement them, I crash and burn. First off, here is code (it is in a javafx controller since music is handled as its own screen and controller class):


When the updateItem method for artWorkTableCell is called, the artWork parameter passed in is null, so we die on a null pointer exception. I've stepped through to where the library track is created, and the album art file path is stored fine as part of the music track data. I'm sure I must somehow be messing up the overloading.

Here is the runtime error I get (showing only for the first table row entry):

SEVERE: javafx.scene.control.Control loadSkinClass Failed to load skin 'StringProperty [bean: TableRow[id=null, styleClass=cell indexed-cell table-row-cell], name: skinClassName, value: com.sun.javafx.scene.control.skin.TableRowSkin]' for control TableRow[id=null, styleClass=cell indexed-cell table-row-cell]
java.lang.NullPointerException
at com.craig.test.sample.music.MusicController$ArtWorkTableCell.updateItem(MusicController.java:145)
at com.craig.test.sample.music.MusicController$ArtWorkTableCell.updateItem(MusicController.java:1)
at javafx.scene.control.TableCell.updateItem(TableCell.java:549)
at javafx.scene.control.TableCell.indexChanged(TableCell.java:105)
at javafx.scene.control.TableCell$1.invalidated(TableCell.java:93)
at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:155)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:100)
at javafx.beans.property.ReadOnlyIntegerWrapper$ReadOnlyPropertyImpl.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:195)
at javafx.beans.property.ReadOnlyIntegerWrapper.fireValueChangedEvent(ReadOnlyIntegerWrapper.java:161)
at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:130)
at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:163)
at javafx.scene.control.IndexedCell.updateIndex(IndexedCell.java:112)
at com.sun.javafx.scene.control.skin.TableRowSkin.updateCells(TableRowSkin.java:251)
at com.sun.javafx.scene.control.skin.TableRowSkin.<init>(TableRowSkin.java:88)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at javafx.scene.control.Control.loadSkinClass(Control.java:1044)
at javafx.scene.control.Control.access$500(Control.java:70)
at javafx.scene.control.Control$12.invalidated(Control.java:972)
at javafx.beans.property.StringPropertyBase.markInvalid(StringPropertyBase.java:127)
at javafx.beans.property.StringPropertyBase.set(StringPropertyBase.java:161)
at com.sun.javafx.css.StyleableStringProperty.set(StyleableStringProperty.java:71)
at javafx.scene.control.Control$12.set(Control.java:964)
at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:59)
at com.sun.javafx.css.StyleableStringProperty.applyStyle(StyleableStringProperty.java:31)
at com.sun.javafx.css.StyleableProperty.set(StyleableProperty.java:70)
at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:900)
at javafx.scene.Node.impl_processCSS(Node.java:7419)
at javafx.scene.Parent.impl_processCSS(Parent.java:1146)
at javafx.scene.control.Control.impl_processCSS(Control.java:1154)
at com.sun.javafx.scene.control.skin.VirtualFlow.setCellIndex(VirtualFlow.java:1598)
at com.sun.javafx.scene.control.skin.VirtualFlow.getCell(VirtualFlow.java:1500)
at com.sun.javafx.scene.control.skin.VirtualFlow.getCellLength(VirtualFlow.java:1523)
at com.sun.javafx.scene.control.skin.VirtualFlow$3.call(VirtualFlow.java:478)
at com.sun.javafx.scene.control.skin.VirtualFlow$3.call(VirtualFlow.java:476)
at com.sun.javafx.scene.control.skin.PositionMapper.computeViewportOffset(PositionMapper.java:143)
at com.sun.javafx.scene.control.skin.VirtualFlow.layoutChildren(VirtualFlow.java:1001)
at javafx.scene.Parent.layout(Parent.java:1018)
at javafx.scene.Parent.layout(Parent.java:1028)
at javafx.scene.Parent.layout(Parent.java:1028)
at javafx.scene.Parent.layout(Parent.java:1028)
at javafx.scene.Parent.layout(Parent.java:1028)
at javafx.scene.Parent.layout(Parent.java:1028)
at javafx.scene.Scene.layoutDirtyRoots(Scene.java:516)
at javafx.scene.Scene.doLayoutPass(Scene.java:487)
at javafx.scene.Scene.access$3900(Scene.java:170)
at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2186)
at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:461)
at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:330)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:89)
at java.lang.Thread.run(Thread.java:724)

Any suggestions as to where I'm messing up?

Many thanks in advance.....
10 years ago
Here is brief snippet of the code I've got:



Here is the error dump when I try and scroll the buttons:
Glass detected outstanding Java exception at -[GlassViewDelegate sendJavaMouseEvent:]:src/com/sun/mat/ui/GlassViewDelegate.m:543
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1449)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Node.fireEvent(Node.java:6867)
at javafx.scene.control.Button.fire(Button.java:179)
at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
at javafx.event.Event.fireEvent(Event.java:171)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3311)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3151)
at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
at com.sun.glass.ui.View.handleMouseEvent(View.java:530)
at com.sun.glass.ui.View.notifyMouse(View.java:924)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1446)
... 40 more
Caused by: java.lang.IllegalArgumentException: Children: duplicate children added: parent = VBox[id=navPanel]
at javafx.scene.Parent$1.onProposedChange(Parent.java:307)
at com.sun.javafx.collections.VetoableObservableList.add(VetoableObservableList.java:165)
at com.sun.javafx.collections.ObservableListWrapper.add(ObservableListWrapper.java:144)
at com.promptu.parnassusfx.sample.MainController.displayNavButtons(MainController.java:179)
at com.promptu.parnassusfx.sample.MainController.navScrollDown(MainController.java:161)
... 50 more

Is there a better way to do what I'm attempting?

Thanks.....
10 years ago
Hi,

I working on a gui that has a fixed display size using a border pane layout. The left layout pane is a vbox that holds five buttons, with a button on the bottom that remains fixed in place and provides scroll up/down capability. there are a total of 8 functions available to user in the vbox, and I want to be able to scroll through them using the scroll buttons. This will change the 5 buttons that are displayed in the vbox. I've tried clearing out all the children of the vbox and then adding them back in different order, but I keep getting errors about addiing duplicate children. I'm sure there must be a simple way to do this....anyone have any pointers?

Thanks
10 years ago
Thank you!! This is exactly the answer I spent most of today googling for. I can't believe this never popped up in any of my searches. I'm off to the races now....

Thanks again.
10 years ago
I'm trying to move from swing to javafx and have run into a problems I've spent all afternoon trying to figure out to no avail. I'm using a standard border pane, with a top Hbox, left Vertical pane then the main user content is in the center pane. Depending on what buttons the user presses in either the top or left menu panes, I want to switch out the content that is being displayed in the main center pane. I have been able to change the anchor pane that is being shown in this area, but am unable to get get at any other fields that I have defined in the different fxml files for pane1, pane2 etc. When I try and access them after I load the new fxml file they are always null.

I'm sure there has to be a simple way of doing this, but I haven't been able to find it.

Any ideas would be appreciated....

Thanks
10 years ago
My bad on the naming conventions, the unruly NavBar variable is now navBar. But adding the navBar to the scroll pane doesn't work. I've read all over that the preferred size is an important variable to set, so I've set that as well. Here are the last two lines in the method now:


When I comment these lines out, I at least get the navBar displayed (showing all 7 buttons instead of the 5 I want), but when I include these lines, the entire navBar disappears.

10 years ago
Hi,

I have spent the last couple of days searching the web trying to find a solution to what no doubt is a simple problem, and have finally given up. What I am trying to do is lay out a touch panel with a JPanel across the top with several buttons on it, then a navigation bar down the side with different buttons, and then a content area making up the rest of the frame. What I am trying to do is have the navigation bar at the side show only 5 buttons at a time, and I want to be able to scroll down to see additional ones. It seems no matter what I do I can't get the scroll bar to show up. Here is the code of the class that builds the bar and adds it to the application JFrame:


When I uncomment the scrollPane.add the entire NavBar disappears. Any help would be greatly appreciated!!

10 years ago
I'm trying clean up my code to put constants in their own class, but I'm running into what is a maddening problem. I have a top level package that contains the constant declaration in its own class file. Then I want to have a package nested one level below the top package level that references the constant defined above. Two simple packages are defined as follows:


What am I doing wrong? I have looked at a bunch of other code examples out on the web and this seems to be the correct way of referencing something. I must be doing something obvious and simple....

Thanks for any help
10 years ago
Thanks- that is exactly the JPanel code I am using. My problem though is that the imageIO.read call is not working. The url string has "file://.....pathname" and the read call always returns null as though it can't find the file. I'm suspecting it is because of the "file:" tag prepended to the path. That actual pathname is correct and the image file is indeed there.

What I'm trying to layout is a GUI that has a panel across the top of the frame that contains an image for the background, and then I want to paint other transparent images on top of this background that will act as buttons.

Thanks....
10 years ago