Bonjour, j'ai découvert récemment une librairie qui s'appelle flamingo qui me permet de créer de jolis composants en Swing comme celui là : ou ceux-là .
Je voulais savoir qui d'entre vous l'a déjà utilisé et si possible d'avoir un tutorial.
Bonjour, j'ai découvert récemment une librairie qui s'appelle flamingo qui me permet de créer de jolis composants en Swing comme celui là : ou ceux-là .
Je voulais savoir qui d'entre vous l'a déjà utilisé et si possible d'avoir un tutorial.
La librairie en elle même est bien foutue, c'est sur.
Par contre niveau tuto il n'y a rien que ce soit en français ou en anglais.
Tu as vaguement la liste des composants décrite dans la page suivante: https://flamingo.dev.java.net/learn.html. Ensuite c'est tout dans la javadoc.
Enfin bon ça reste une librairie de composant avec une javadoc très bien faite (au contraire de beaucoup de librairies). Donc de fait il est relativement aisé de travailler avec.
Je connais déjà cette page et j'ai été déçu par manque de tutorial.
J'ai téléchargé les exemples qui sont dans la librairie mais ca me sort une exception zarrrebi que je n'arrive pas à corriger :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 Exception in thread "main" java.lang.IllegalStateException: Inconsistent preferred widths Ribbon band 'Edition has the following resize policies org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Mirror with preferred width 49 org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Mid2Low with preferred width 49 org.jvnet.flamingo.ribbon.resize.IconRibbonBandResizePolicy with preferred width 58 org.jvnet.flamingo.ribbon.resize.CoreRibbonResizePolicies$Mid2Low with pref width 49 is followed by resize policy org.jvnet.flamingo.ribbon.resize.IconRibbonBandResizePolicy with larger pref width at org.jvnet.flamingo.utils.FlamingoUtilities.checkResizePoliciesConsistency(FlamingoUtilities.java:575) at org.jvnet.flamingo.ribbon.AbstractRibbonBand.setRibbonTask(AbstractRibbonBand.java:566) at org.jvnet.flamingo.ribbon.RibbonTask.<init>(RibbonTask.java:90) at fr.upmc.dsi.siview.view.MainWindow.configureRibbon(MainWindow.java:78) at fr.upmc.dsi.siview.view.MainWindow.<init>(MainWindow.java:66) at fr.upmc.dsi.siview.view.MainWindow.main(MainWindow.java:204)
Le bout de code qui fait tout foirer :
Est ce que tu pourrais m'aider à comprendre ce truc de "policies" stp?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 protected JRibbonBand createEditBand(){ JRibbonBand editband = new JRibbonBand("Edition", new editpaste2()); RichTooltip tooltip = new RichTooltip("Edit", "Cut, Copy, Paste, Zoom In and Zoom out"); editband.setExpandButtonRichTooltip(tooltip); JCommandButton paste = new JCommandButton("Paste", new editpaste2()); paste.addActionListener(new ActionMenu()); paste.setCommandButtonKind(CommandButtonKind.ACTION_ONLY); RichTooltip paste_tooltip = new RichTooltip("Paste", "Paste an element to the graph"); paste.setActionRichTooltip(paste_tooltip); JCommandButton copy = new JCommandButton("Copy" , new editcopy()); copy.addActionListener(new ActionMenu()); copy.setCommandButtonKind(CommandButtonKind.ACTION_ONLY); RichTooltip copy_tooltip = new RichTooltip("Cut", "Cut an element from the graph"); copy.setActionRichTooltip(copy_tooltip); JCommandButton cut = new JCommandButton("Cut", new editcut()); cut.addActionListener(new ActionMenu()); cut.setCommandButtonKind(CommandButtonKind.ACTION_ONLY); RichTooltip cut_tooltip = new RichTooltip("Cut", "Cut an element from the graph"); cut.setActionRichTooltip(cut_tooltip); editband.addCommandButton(paste, RibbonElementPriority.TOP); List<RibbonBandResizePolicy> resizePolicies = new ArrayList<RibbonBandResizePolicy>(); resizePolicies.add(new CoreRibbonResizePolicies.Mirror(editband .getControlPanel())); resizePolicies.add(new CoreRibbonResizePolicies.Mid2Low(editband .getControlPanel())); resizePolicies.add(new IconRibbonBandResizePolicy(editband .getControlPanel())); editband.setResizePolicies(resizePolicies); return editband; }
Merci d'avance pour ton aide
Salut, j'ai trouvé la solution.
En fait, j'ai pas rajouté les autres bouton cut, copy dans mon composant.
Ce serait bien qu'on écrive un tutorial pour introduire cette librairie parce que je trouve très fun .
Bon courage
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager