Pablo Gallardo's Blog
My professional web log about IT, Project Management & SAP
Archive | Development RSS feed for this section

How to display an image on Java Swing

Images can be displayed in Java Swing using object JLabel. This is the partial code: JLabel label = new JLabel(); try { BufferedImage img = File(IMG_FILES_PATH + IMG_FILENAME)); ImageIcon icon = new ImageIcon(img); label.setIcon(icon); } catch (IOException ex) { Logger.getLogger(SwingGUIMainScreen.class.getName()).log(Level.SEVERE, null, ex); } If I need the image to have an specific size, what […]

Comments { 0 }

How to scale an image in Java

I programmed my own function, based on other examples: /** * Method that scale an image (BufferedImage) into the specified dimensions * @param sbi Source image * @param imageType Image type among BufferedImage.TYPE_… constants (example: TYPE_INT_ARGB) * @param dWidth Image width, in pixels * @param dHeight Image height, in pixels * @return Destination image */ […]

Comments { 0 }

How to create JAR file for Java project

Ensure your project takes into account all considerations Follow the instructions on the link below: Java SE Deploy Build JAR file JAR file is built automatically from IDE like Eclipse or Apache NetBeans. Setting the icon for your JAR file You cannot change the default JAR icon of your application. Instead, you can generate an […]

Comments { 0 }

How to set dock icon of Java application

This solution is only available from JDK 9. In other to set the JDK version on NetBeans, right click on Project > “Properties” >> “Sources” > “Source/Binary format”; and “Libraries” > “Java Platform”. package main; import javax.swing.JFrame; import javax.swing.JLabel; import java.awt.Image; import java.awt.Taskbar; import java.awt.Toolkit; import; /** * author: flohall * date: 2019-07-07 */ […]

Comments { 0 }

Play sound clip from local file in Java

This solution works only for .wav files. Source code: public void playSound() { try { AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(“D:/MusicPlayer/fml.mp3″).getAbsoluteFile()); Clip clip = AudioSystem.getClip();; clip.start(); } catch(Exception ex) { System.out.println(“Error with playing sound.”); ex.printStackTrace(); } }   Source: “Playing .mp3 and .wav in Java?“, stackoverflow

Comments { 0 }

Install Android Studio in Mac

Android Studio is the official Google’s IDE to develop apps for Android, based on IntelliJ.   1. Download file Download latest Android Studio version for Mac (3.2.1 at the time of this article). 2. Install application Double-click on .dmg file and drag and drop Android Studio icon into Applications folder. 3. Run application Open Android […]

Comments { 0 }

Software Publisher Certificate Code Signing on Windows–spc-

Comments { 0 }

List of Prototyping and Mockup Apps

This is a non-exhaustive list of prototyping and mockups apps.   Balsamiq Commercial, 30-day trial version Web-based.   InVision   Marvelapp Freemium. Web-based.   Moqups Freemium. Web-based.   Pencil Project Open source, free. Desktop-based. There is a discontinued web-based version (Mozilla add-on).   Sketch   Zeplin  

Comments { 0 }
Política de privacidad