-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Animation and basic operation #282
Comments
Indeed, the Windows 10 minimize/maximize/restore window animations are missing when clicking one of the buttons in the title bar. On the other hand, when right-clicking on title bar and selecting those commands from context menu, the animations are there. The difference is that when clicking the buttons, FlatLaf uses Java API to minimize/maximize/restore window. The context menu comes from Windows 10.
Hmm, this works for me.
Could you please describe in more detail what you do and what you expect? |
Hey First of all Thanks for this super quick response I am impressed how involved you all are and its amazing !! I have made a very small test application would you be able to guide me throught ? here is the code public class Main {
public static void main(String[] args) {
//Invoke menu
SwingUtilities.invokeLater(new Runnable() {
public void run() {
//Install flat laf Look and Feel
FlatArcDarkOrangeIJTheme.install();
//Set the UI Look and Feel
try {
System.setProperty("flatlaf.useWindowDecorations", "true");
System.setProperty( "flatlaf.uiScale", "1.25x" );
System.setProperty( "flatlaf.animatedLafChange", "true" );
UIManager.setLookAndFeel(new FlatArcDarkOrangeIJTheme());
UIManager.put( "Button.arc", 999 );
} catch (Exception ex) {
System.err.println("Failed to initialize LaF");
JOptionPane.showMessageDialog(new JFrame(), "Eggs are not supposed to be green. (Laf error)");
}
Menu menu = new Menu();
menu.setLocationRelativeTo(null);
menu.setVisible(true);
}
});
}
} and here is the Menu: public class Menu extends javax.swing.JFrame {
public Menu() {
initComponents();
loadFonts();
}
public final void loadFonts() {
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel3 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jPanel1 = new javax.swing.JPanel();
jSeparator1 = new javax.swing.JSeparator();
jButton1 = new javax.swing.JButton();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Bond");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 1186, Short.MAX_VALUE)
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 566, Short.MAX_VALUE)
);
jTabbedPane1.addTab("Home", jPanel3);
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null, null},
{null, null, null, null},
{null, null, null, null},
{null, null, null, null}
},
new String [] {
"Title 1", "Title 2", "Title 3", "Title 4"
}
));
jScrollPane1.setViewportView(jTable1);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1186, Short.MAX_VALUE)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE))
);
jTabbedPane1.addTab("TableView", jPanel2);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 1186, Short.MAX_VALUE)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 566, Short.MAX_VALUE)
);
jTabbedPane1.addTab("GraphsView", jPanel1);
jButton1.setText("RUN");
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.Alignment.LEADING))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(9, 9, 9))
);
pack();
}// </editor-fold>
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTable jTable1;
// End of variables declaration
} Im using netbeans but you should easily be able to copy and recreate the classes? |
Code works perfectly.
Have you seen this: #282 (comment) |
Oh I see, I was on 1.0 I just changed and yes you're correct it works all perfect!! Thanks a lot again I'm going to continue to learn it but its defo an amazing tool !!! |
I have read #282 (comment) and it makes a lot of sense. I will apply it to my code! :D Thanks for the time taken |
…maximizing or restoring a window using window title bar buttons (issue #282)
The missing animations when maximizing/minimizing a frame are now fixed in main branch. |
Hello I am new To Flat LAf and I didn't know where to leave an issue. I cannot figure how to use basic animation like when reducing windows? Also When dragging using the laf decoration to an end of a screen it doesn't not resize it ? Can someone help ?
The text was updated successfully, but these errors were encountered: