How to update quantity of books in MSADB using java swing

Hi,

I want a user to be able to update the amount of books (qty_available) in the database using my swing application. my problem is I'm struggling with the SQL side of things and I don't know how to fully approach this issue.

I want to have the Book_ID in a dropdown list so the user can select for example number 4 then I want the user to be able to update the qty_available from 0. I plan on using the scanner lib to get user input.

DB FORMAT

Table named - Books

Book_ID, book,name, qty_available

book_ID auto increments from 1 and the qty available is set to 0 for all books.

does anyone have any ideas?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/betfredlover
πŸ“…︎ May 11 2021
🚨︎ report
UI Programmers wanted for contrib team: Java Swing, Android, iOS. We need your help!

Hi folks,

We have quite a few programmers on the volunteer contributor team now, but they're almost all backend folks.

A lot of important new game features are gated on UI. All three of our game clients (Android, iOS, Steam) need a ton of work.

Examples:

  • the iOS client needs to be ported from Objective-C to Swift. You just need to know Swift and the basics of iOS programming, and this project is easy. You can do it 1 file at a time, and I bought a license for Swiftify to do initial conversion automatically!

  • the iOS client needs a new rendering pipeline that uses threads and a producer/consumer model. Both the Android and Steam client have similar pipelines that you can just copy / port to iOS.

  • the iOS client is behind the Android client on features.

  • all the clients are going to need new Builder Mode functionality as we gear up for more competitions and player contributions.

  • All 3 clients are going to need body parts UI as outlined in this post

  • All 3 clients could use dramatically enhanced chat capabilities, for managing multiple conversations and keeping conversation history.

  • Both mobile clients are starting to fall behind Steam on features, such as outlining the monster that you're attacking.

These are just examples. The Map Editor also needs a TON of work for the core team, and it's written in Java Swing. Swing is a very easy toolkit to use, and is quite powerful -- the world-famous IntelliJ IDEA IDE is written in Swing, for example. Or if JavaFX is your schtick, we could port the client and/or map editor to JavaFX. I'm game for anything if it helps me get contributors.

I'm also open to React Native or Flutter clients, if that's your thing. Would be cool to consolidate the mobile clients into a single code base.

If you are a C++ or C# programmer and want to make a native client for Windows, I'd be open to that as well.

Finally, if you're a network coding expert and want to tackle WebSockets, then we'll be able to do an HTML client so you can play Wyvern in the browser. Let me know! We have several strong JavaScript/browser folks standing by waiting for WebSockets so they can start on the client.

Fingers crossed. I'll keep this post up for a while and hope we catch someone's interest.

πŸ‘︎ 21
πŸ’¬︎
πŸ‘€︎ u/rhialto
πŸ“…︎ May 06 2021
🚨︎ report
Need some help understanding something (Java with Java Swing)
package ui.board;
import java.util.ArrayList;

public class GameRecord {
    private ArrayList list = new ArrayList();

    public GameRecord(){

    }

    public ArrayList list() {
        list.add(Board.p);
        for(int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        return list;
    }


    public void undo() {
        int index = list.size() - 1;
        list.remove(index);
    }
}

package ui.board;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Board extends JPanel {
    static final int size = 19;
    private Stone[][] board = new Stone[size][size];
    public static Point p;


    
    public static JPanel generateBoardPanel() {
        JPanel panel = new JPanel();
        BorderLayout bl = new BorderLayout();
        bl.setHgap(100);
        bl.setVgap(100);
        panel.setLayout(bl);
        panel.add(new GoPanel(19), BorderLayout.CENTER);
        return panel;
    }

    static class GoPanel extends JPanel {

        Square[][] board;
        boolean blackToMove;

        GoPanel(int dimension) {
            board = new Square[dimension][dimension];
            blackToMove = true;
            initBoard(dimension);
        }

        private void initBoard(int dimension) {
            super.setLayout(new GridLayout(dimension, dimension));
            for(int row = 0; row < dimension; row++) {
                for(int col = 0; col < dimension; col++) {
                    board[row][col] = new Square(row, col);
                    super.add(board[row][col]);
                }
            }
            repaint();
        }
        public class Square extends JPanel {
            Stone stone;
            public final int row;
            public final int col;

            Square(int r, int c) {
                stone = Stone.EMPTY;
                row = r;
                col = c;

                
                super.addMouseListener(new MouseAdapter(){
                    @Override
                    public void mouseClicked(MouseEvent me) {
                        if(stone != Stone.EMPTY) return;
... keep reading on reddit ➑

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Benjik26
πŸ“…︎ Mar 26 2021
🚨︎ report
I have seen a lot of posts asking about Java and game development. I will post this video of a game/tool for tabletop RPGs that I am making using SWING, I think that depending on what you are trying to achieve swing is still a valid option and more than enough for a lot of situations. youtube.com/watch?v=icLE4…
πŸ‘︎ 154
πŸ’¬︎
πŸ‘€︎ u/The_Augur
πŸ“…︎ Jan 09 2021
🚨︎ report
Java devs, are swing or Javafx used commonly in your profession?

As part of my CompSci degree at university we've been learning to use Swing (which I'm pretty sure is very outdated) and javafx which is supposed to be more common, but I haven't seen any jobs, both grad or experienced asking for javafx experience. Is this something that should be taught or is it not worth anything in the workplace?

Thanks!

πŸ‘︎ 15
πŸ’¬︎
πŸ‘€︎ u/JJosuke434
πŸ“…︎ Mar 02 2021
🚨︎ report
Is there a website or free course to practice java swing?

I have a test tomorrow and really need to practice. Any help is greatly appreciated. Thanks!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Jimmymcjimface
πŸ“…︎ Apr 30 2021
🚨︎ report
Java Swing Application deployment

Hello folks,

Is it possible to deploy a Swing UI app on heroku/netlify or any other such free services? If so, can you please nudge me in the right direction as to how to do it? I have a working jar file.

I'm a complete noob when it comes to deployment, so any help will be appreciated.

Edit: I haven't been clear - I would like to deploy the desktop app as a web app on a cloud service to run it online.

Thank you!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Disfatt_Bidge54
πŸ“…︎ Mar 08 2021
🚨︎ report
I used some Java Swing to visualize a neural network's output
πŸ‘︎ 726
πŸ’¬︎
πŸ‘€︎ u/longuyen2306
πŸ“…︎ Jan 11 2021
🚨︎ report
Java Swing Vs JavaFX

Salutare, as vrea sa ma apuc de o mica aplicatie cu GUI in Java ca sa ma ajute pentru internship. Intrebarea este, care din cele doua este mai folosita in Romania si mai util in general, JavaFX sau Java Swing? Am vazut ca FX este mai nou si mai usor de utilizat dar Swing pare inca folosit mult, sau ar trebui sa le invat pe amandoua? Aveti si alte sugestii care sa ma ajute? Multumesc anticipat.

πŸ‘︎ 10
πŸ’¬︎
πŸ‘€︎ u/Klussux
πŸ“…︎ Feb 10 2021
🚨︎ report
[ Code : 999MARCH ] 7 Popular Courses from $9.99 - Complete Python Bootcamp! Build Real Python Projects In 2021, (100 Common Projects), Complete Java Bootcamp! Swing, JavaFX, PostgreSQL, JDBC, JSP, Complete Codecamp On C, C++, C#, Java & Python Programming! & More
πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/ViralMedia007
πŸ“…︎ Mar 19 2021
🚨︎ report
[Help] Java Swing for iOS

I am attempting to run a Java Swing application on iOS. So far, I have installed openjdk-16-jdk on my iPhone, but when I try to run my application, it throws a headless exception. I know that PojavLauncher uses Java (because Minecraft is java), so I know that it is possible to run a Java GUI application on iOS. Is there any way I could do this? I know that there is development for X11 on iOS, but the Cydia repo is no longer there, and trying to fork it and adding a Github Pages resulted in the package asking for lots of non-installable dependencies. Could someone please help?

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/GoodFantastic1778
πŸ“…︎ Feb 25 2021
🚨︎ report
Java Swing JPanel and getContentPane() help

Hello, I am currently trying to make a game that has a start screen that consists of a "start" button, "scores" button, and "quit" button. I have 3 classes so far, one called Stacker.java which consists of the main application to set up the GUI.

Stacker.java

import javax.swing.*;
public class Stacker {
    public static void main(String[] args) {
        //Creates the GUI window
        GUIWindow theGUI = new GUIWindow();
        theGUI.setTitle("Stacker");
        theGUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        theGUI.setSize(300, 500);
        theGUI.setVisible(true);
        theGUI.setResizable(false);
    }
}

This sets up the GUI by calling my next class, GUIWindow.java. This class is where the GUI is coded. Since this is too long to post here, this is a link to the code. From lines 78 - 91 is where I think my problem is right now. Once that highScores JButton is pressed, I want it to change the container so that those new JLabels and JButtons are present. My guess on why this doesn't work is because both containers are referencing the same contentPane so it won't update.

So, the big problem I need help with is after the highScores button is clicked, that it should display the new JLabels and JButtons that I want. I do have another class, but I don't think that is causing the problem since it just checks for a .txt file and if it is present it reads the file and sends back the contents to display in the JLabel.

Edit: What I have tried so far on my own is to set the visibility of the menuContainer to false, then set the visibility of the scoresContainer to true, but this doesn't work either. I got the validate() and repaint() code (lines 90-91) from a StackOverflow question, since I have been trying to find help on this problem for a while now. I'm fairly new to using graphics in java, so I am trying this with very basic knowledge.

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/bruhman30
πŸ“…︎ Jan 14 2021
🚨︎ report
IntelliJ IDEA is a pure Java Swing application. All the custom components like editor tabs are created manually, no third-party libraries are used for this.
πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/circuit10
πŸ“…︎ Feb 18 2021
🚨︎ report
Does anyone remember Java Web Start and Swing?

We have an archaic application that has never been properly updated. It runs a bizarre concoction of Java technologies, but we are currently only interested in Web Start. The Web Start application is running on Windows via Java 8. This application has been running smoothly for years, hasn't seen a code change in about a year, but has been acting 'funny' ever since the New Year.

Our company runs on 4 environments

- DEV

- TEST

- PROD

- BCS

BCS is our Business Continuity Site. Just in case, it's a copy of Prod in a remote location in case our prod environment explodes. Today we ran a BCS test which effectively means cutting the pipe between PROD and BCS, putting the BCS into Production Mode (DNS changes, setting DBs toPrimary, and various similar things) then having teams run their work from BCS as if they were in the main office. Given COVID, people simply VPNed to a different location from their homes.

The problem arose after the test concluded. For some reason, 2 employees who were part of the test somehow have some signals crossed in their environments. After they logged out of our BCS VPN and connected back to headquarters, whenever they try hitting the PROD environment their Web Start application automatically switches to the TEST environment. I have manually gone into the JNLP files, and they are definitely pointed to PROD. If I point it to DEV, the Application starts correctly, TEST also starts correctly, but if I point it to PROD it somehow starts on DEV.

The machines themselves ping each environment correctly, so I don't think its a machine problem. I have tried going into the Configure Java application and cleared out all files, but that didn't help. Obviously we have rebooted the machines several times and tried clearing browser caches and anything else we could think of. At this point, I am simply trying to get some ideas of other things to try. Any thoughts would be most appreciated.

TLDR - After BCS test, on 2 machines our Web Start app maps to TEST when the JNLP file is pointing to PROD. Pointing to DEV works fine, and the machines pings DEV, TEST and PROD fine.

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/iammanic
πŸ“…︎ Jan 14 2021
🚨︎ report
Architectural patterns for Java Swing applications

I'm a .NET developer dabbling in Java, and having a look at Swing. I would like to find out how to build Swing applications that are maintainable, and unit-testable (if practical, or possible).

In the .NET world, there is a lot of information about architecting desktop apps using the two main available frameworks, WinForms and WPF. In particular, WPF is designed to support databinding and the MVVM pattern. With WinForms, it seems that it was not designed with any particular architectural pattern in mind, and doesn't really support one of them "out-of-the-box". However, many developers have recommended utilising the MVP (Model-View-Presenter) pattern to ensure testability. That is, the View is a very thin layer consisting of an interface that the presenter uses to direct it in displaying things to the user. The presenter subscribes to events from the view, and responds to events, modifying the view. The presenter takes the View, and the Model (object model/persistence) as dependencies. It is rather tedious to implement, but works well in terms of being able to unit-test the UI itself. There are several examples of this: http://geekswithblogs.net/lennykean/archive/2012/02/21/winforms-and-mvp-making-a-testable-application.aspx

In Java Swing, is it practical to try and maximise the ability to unit-test the application as much as possible? Is there any architectural pattern recommended to achieve this? Or is it not that simple? I have seen several articles showing examples of MVP and MVC (Model-View-Controller) patterns being implemented in Swing apps, but does it really enhance testability?

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/al95eng
πŸ“…︎ Jan 29 2021
🚨︎ report
In CPSC1181, Do They Use Java Swing Or JavaFX?

What's the approach to making GUI's in this course? Using Java Swing or JavaFX? I heard JavaFX is the best to use but I think the version of Java I have installed does not have JavaFX. I tried importing it, but nothing happens.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/GalacticStudent
πŸ“…︎ Dec 20 2020
🚨︎ report
I made a pure Java Swing application to train and visualize a neural network
πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/longuyen2306
πŸ“…︎ Jan 11 2021
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.