Code Sketch


Bixuu02 harrypotter part-3
By: Mhalsakant School
Category: Programming
//> using platform jvm
//> using jvm 17

import javax.swing._
import javax.swing.event._
import java.awt._
import java.awt.event._

object HarryPotterPart3App {

  def main(args: Array[String]): Unit = {

    SwingUtilities.invokeLater(new Runnable {
      def run(): Unit = {

        // 1. SECURITY VERIFICATION
        val correctPassword = "Bixuu02_anime"
        val userInput = JOptionPane.showInputDialog(
          null,
          "? HARRY POTTER SECURITY VERIFICATION (PART 3)\n\nPlease enter Password to access Harry Potter Part 3 Story:",
          "Harry Potter Part 3 Access",
          JOptionPane.QUESTION_MESSAGE
        )

        if (userInput == null || userInput != correctPassword) {
          JOptionPane.showMessageDialog(
            null,
            "? Access Denied! Incorrect Password.",
            "Error",
            JOptionPane.ERROR_MESSAGE
          )
          sys.exit(0)
        }

        // 2. STORY DATA (HARRY POTTER PART 3 - EPISODES 1 TO 20 in Hindi & English)
        val storyData: Map[String, String] = Map(
          "Chapter 1: Aunt Marge's Big Mistake" ->
            """==================================================
              |HARRY POTTER PART 3: THE PRISONER OF AZKABAN
              |Written & Adapted by Bixuu (Hindi & English Mix)
              |==================================================
              |
              |MAIN CHARACTERS:
              | - Harry Potter (The Boy Who Lived)
              | - Sirius Black (The Prisoner of Azkaban)
              | - Professor Remus Lupin & Hermione Granger
              | - Ron Weasley & Buckbeak
              |
              |CHAPTER 1 STORY & DIALOGUES:
              |Privet Drive par Dursley family ke ghar Aunt Marge aati hai jo Harry ke mata-pita ke khilaf bura-bhala kehti hai. Harry gusse mein apna control kho deta hai aur magic ki wajah se Aunt Marge ek gubbare ki tarah fool kar hawa mein udne lagti hai.
              |
              |Harry: "Main ab yahan ek pal bhi nahi ruk sakta!" (Harry apna bag uthakar bhaag jata hai.)
              |===================================================""".stripMargin,

          "Chapter 2: The Knight Bus" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 2 STORY & DIALOGUES:
              |Raat ke andhere mein sadak par khade Harry ke samne achanak ek tezi se bhagne wali purple color ki triple-decker bus 'The Knight Bus' ????? hoti hai. Wo use London ke 'The Leaky Cauldron' tak le jati hai.
              |
              |Conductor (Stan Shunpike): "Welcome to the Knight Bus! Emergency transport for the stranded witch or wizard."
              |===================================================""".stripMargin,

          "Chapter 3: The Minister's Warning" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 3 STORY & DIALOGUES:
              |Leaky Cauldron mein Minister of Magic Cornelius Fudge Harry se milta hai aur use batata hai ki Azkaban jail se ek khatarnak kaatil Sirius Black bhaag gaya hai jo specifically Harry ko maarne ke liye dhoond raha hai.
              |
              |Fudge: "Harry, Sirius Black wahan se sirf ek maqsad ke liye bhaaga hai... aur wo tum ho!"
              |===================================================""".stripMargin,

          "Chapter 4: The Monster Book of Monsters" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 4 STORY & DIALOGUES:
              |Hogwarts Express mein doston ka reunion hota hai. School pahunchne par Rubeus Hagrid ko Care of Magical Creatures ka naya teacher banaya jata hai. Wo pehli class mein ek aisi book dete hain jo kaatne ki koshish karti hai.
              |
              |Hermione: "Tumhe book ko stroke karna padta hai, tab wo shant hoti hai!"
              |===================================================""".stripMargin,

          "Chapter 5: The Dementor on the Train" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 5 STORY & DIALOGUES:
              |Jab train Hogwarts ja rahi hoti hai, toh achanak raste mein andhera ho jata hai aur train ruk jati hai. Saye mein chalne wale aatma jaise creatures?Dementors?train mein ghus aate hain. Harry ki saari khushiyan cheen li jati hain aur wo behosh ho jata hai. Naye teacher Remus Lupin ek magic se Dementor ko bhaga dete hain.
              |
              |Lupin: "Ye chocolate khao, tumhe behtar lagega."
              |===================================================""".stripMargin,

          "Chapter 6: Talons and Tea Leaves" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 6 STORY & DIALOGUES:
              |Divination class mein Professor Trelawney tea leaves (chai ki patti) dekh kar bhavishyavani karti hain. Wo Harry ke cup mein 'The Grim' (ek maut ka kala kutta) ka nishana dekhti hain aur darr ka mahaul ban jata hai.
              |
              |Trelawney: "My dear boy... you have the Grim in your tea leaves!"
              |===================================================""".stripMargin,

          "Chapter 7: Buckbeak's Flight" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 7 STORY & DIALOGUES:
              |Hagrid ki class mein adha-ghoda adha-baaz (Hippogriff) jiska naam Buckbeak hota hai, uski pehchan karwai jati hai. Harry uske samne jhuk kar respect dikhata hai aur fir Buckbeak ki peeth par baith kar aasmaan mein unchaai par udan bharta hai.
              |
              |Harry (Khushi se chillate hue): "Woohoo! Ye amazing hai!"
              |===================================================""".stripMargin,

          "Chapter 8: The Boggart in the Wardrobe" ->
              """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 8 STORY & DIALOGUES:
              |Defense Against the Dark Arts class mein Lupin ek Boggart (jo insaan ke sabse bade darr ka roop le leta hai) ko samne laate hain. Jab wo Harry ke samne aata hai, toh Lupin turant beech mein aa kar use ek aam chand (moon) ya Dementor mein badal dete hain aur "Riddikulus" spell sikhate hain.
              |
              |Lupin: "Fokas karo, apne darr ko mazak mein badal do!"
              |===================================================""".stripMargin,

          "Chapter 9: Flight of the Fat Lady" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 9 STORY & DIALOGUES:
              |Ek raat jab sabhi so rahe hote hain, toh Sirius Black castle ke andar ghus jata hai. Jab Gryffindor common room ka darwaza kholne wali 'Fat Lady' use andar aane se rokti hai, toh Sirius gusse mein uski painting ko faad kar bhaag jata hai. Poore school mein emergency ghoshit ho jati hai.
              |
              |Dumbledore: "Castle ko lock karo, Sirius Black andar hai!"
              |===================================================""".stripMargin,

          "Chapter 10: The Marauder's Map" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 10 STORY & DIALOGUES:
              |Fred aur George Weasley Harry ko ek jaadui naksha dete hain?'The Marauder's Map'. Is nakshe par Hogwarts ke har kone aur har insaan ki live location dikhti hai. Isme likha hota hai: "I solemnly swear that I am up to no good."
              |
              |Harry: "Ye naksha toh kamaal ka hai!"
              |===================================================""".stripMargin,

          "Chapter 11: Secret Trip to Hogsmeade" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 11 STORY & DIALOGUES:
              |Marauder's Map ki madad se Harry ek secret underground tunnel ke raste se chupke se Hogsmeade village pahunch jata hai. Wahan Malfoy aur uske friends Harry ko dekh kar pareshan karte hain, par Invisibility Cloak pehne Harry mitti ka gola mar kar Malfoy ki beizzati kar deta hai.
              |
              |Malfoy: "Kaun tha wo?! Kisne mara?!"
              |===================================================""".stripMargin,

          "Chapter 12: The Execution of Buckbeak" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 12 STORY & DIALOGUES:
              |Malfoy ke uksane par Ministry Buckbeak (Hippogriff) ko saza-e-maut sunati hai. Hagrid rote hue apne dost ko bachane ki koshish karta hai. Harry, Ron aur Hermione Hagrid ke cabin mein jaakar use dilasa dete hain.
              |
              |Hagrid: "Wo bas ek nirdosh janwar hai..."
              |===================================================""".stripMargin,

          "Chapter 13: Learning the Patronus Charm" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 13 STORY & DIALOGUES:
              |Harry ki request par Professor Lupin use Dementors se bachne ke liye ek advanced spell sikhate hain?'Expecto Patronum'. Harry apni sabse khubsurat yaad (happy memory) par focus karke ek silver animal energy nikalne ki practice karta hai.
              |
              |Lupin: "Apni sabse khushi ki yaad dhoondo, Harry! Wahi tumhe bachayegi."
              |===================================================""".stripMargin,

          "Chapter 14: Catching Peter Pettigrew" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 14 STORY & DIALOGUES:
              |Ek din Marauder's Map par Harry dekhta hai ki school ke andar ek aisa insaan chal raha hai jo mar chuka hai?Peter Pettigrew! Jab Harry map ko follow karta hai, toh Lupin aur Sirius Black achanak samne aa jate hain.
              |
              |Sirius Black: "Wohi asli gaddaar hai jisne tumhare parents ko dhokha diya!"
              |===================================================""".stripMargin,

          "Chapter 15: The Shrieking Shack" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 15 STORY & DIALOGUES:
              |Sirius aur Lupin dono milkar Ron ke pet chuhe 'Scabbers' ko pakadte hain. Ron ka chuha achanak insaan mein badal jata hai?wohi Peter Pettigrew hota hai jisne saalon pehle Potter family ko Voldemort ke hawale kiya tha.
              |
              |Peter (Hath jodte hue): "Mujhe mat maro, doston! Main majboor tha!"
              |===================================================""".stripMargin,

          "Chapter 16: The Werewolf Unleashed" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 16 STORY & DIALOGUES:
              |Waqt beete bina hi raat ko poornima (full moon) nikal aati hai. Professor Lupin apni dawa peena bhool gaye the, isliye wo achanak ek khatarnak werewolf mein badal jate hain. Peter Pettigrew mauka paakar andhere mein bhaag jata hai.
              |
              |Sirius (Kutte ka roop lekar): "Bhago! Main use sambhalta hoon!"
              |===================================================""".stripMargin,

          "Chapter 17: The Dementor's Lake Attack" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 17 STORY & DIALOGUES:
              |Jheel ke kinare hazaron Dementors Sirius aur Harry par hamla kar dete hain. Harry poori takat lagata hai par darr ki wajah se behosh hone lagta hai. Aakhri pal mein ek bright silver stag (hirn) aakar sare Dementors ko bhaga deta hai. Harry ko lagta hai ki ye uske pita ne kiya tha.
              |
              |Harry (Behosh hone se pehle): "Dad..."
              |===================================================""".stripMargin,

          "Chapter 18: Hermione's Secret Time-Turner" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 18 STORY & DIALOGUES:
              |Hospital wing mein hosh aane par Harry ko pata chalta hai ki Sirius ko execution ke liye qaid kar liya gaya hai. Professor Dumbledore chupke se Hermione ko ishaara karte hain ki wo apne 'Time-Turner' ka istemal karke waqt ko peeche le jayein.
              |
              |Hermione: "Humein 3 ghante peeche jana hoga!"
              |===================================================""".stripMargin,

          "Chapter 19: Saving Buckbeak and Sirius" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 19 STORY & DIALOGUES:
              |Hermione aur Harry pichle samne jaakar sabse pehle Buckbeak ko execution se bacha lete hain. Uske baad wo jheel ke paas jaakar dekhte hain ki purane Harry par Dementors hamla kar rahe hain. Naya Harry samajh jata hai ki wo silver stag aur koi nahi balki wahi khud tha (Expecto Patronum!). Wo spell chalakar sabko bachata hai aur Buckbeak par baithakar Sirius ko aazad kar deta hai.
              |
              |Harry: "We did it, Hermione!"
              |===================================================""".stripMargin,

          "Chapter 20: Part 3 Grand Finale & Epilogue" ->
            """==================================================
              |WRITTEN BY BIXUU
              |==================================================
              |CHAPTER 20 STORY & DIALOGUES (TRILOGY FINALE / PART 3 FINALE):
              |Term khatam hone par Harry ko Sirius Black ki taraf se ek naya aur tez-taran broomstick milta hai?'The Firebolt'. Harry khushi se aasmaan mein udne lagta hai.
              |
              |Harry (Smiling): "I'm ready for anything."
              |
              |THE END - HARRY POTTER PART 3 WRITTEN & ADAPTED BY BIXUU.
              |==================================================
              |
              |? ANNOUNCEMENT FROM CREATOR BIXUU:
              |"BIXUU SUCCESSFULLY CREATED HARRY POTTER PART 3 (PRISONER OF AZKABAN)! 
              |Hope you loved the entire journey so far!"
              |===================================================""".stripMargin
        )

        // 3. GUI WINDOW CREATION
        val frame = new JFrame("Harry Potter Viewer: HARRY POTTER PART 3 - By Bixuu")
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE)
        frame.setSize(950, 650)
        frame.setLocationRelativeTo(null)

        // Header Theme Color (Wizarding Dark Maroon & Gold)
        val headerLabel = new JLabel("  ? HARRY POTTER PART 3: THE PRISONER OF AZKABAN (Adapted by Bixuu)  ", SwingConstants.CENTER)
        headerLabel.setFont(new Font("Arial", Font.BOLD, 14))
        headerLabel.setOpaque(true)
        headerLabel.setBackground(new Color(40, 10, 10))
        headerLabel.setForeground(Color.WHITE)
        headerLabel.setPreferredSize(new Dimension(950, 40))

        // Chapter List
        val chapterKeys = (1 to 20).map(i => storyData.keys.find(_.startsWith(s"Chapter $i:")).getOrElse(s"Chapter $i")).toArray
        val listModel = new DefaultListModel[String]()
        chapterKeys.foreach(listModel.addElement)

        val chapterList = new JList[String](listModel)
        chapterList.setFont(new Font("Arial", Font.PLAIN, 12))
        chapterList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
        chapterList.setSelectedIndex(0)

        val listScrollPane = new JScrollPane(chapterList)
        listScrollPane.setPreferredSize(new Dimension(320, 500))

        // Story Text Area
        val storyArea = new JTextArea()
        storyArea.setFont(new Font("Monospaced", Font.PLAIN, 13))
        storyArea.setEditable(false)
        storyArea.setLineWrap(true)
        storyArea.setWrapStyleWord(true)
        storyArea.setBackground(new Color(20, 20, 20))
        storyArea.setForeground(new Color(230, 230, 230))
        storyArea.setText(storyData(chapterKeys(0)))
        storyArea.setCaretPosition(0)

        val textScrollPane = new JScrollPane(storyArea)

        // Selection Listener
        chapterList.addListSelectionListener(new ListSelectionListener {
          def valueChanged(e: ListSelectionEvent): Unit = {
            if (!e.getValueIsAdjusting) {
              val selectedKey = chapterList.getSelectedValue
              if (selectedKey != null && storyData.contains(selectedKey)) {
                storyArea.setText(storyData(selectedKey))
                storyArea.setCaretPosition(0)
              }
            }
          }
        })

        // Layout Assembly
        val mainPanel = new JPanel(new BorderLayout())
        mainPanel.add(headerLabel, BorderLayout.NORTH)
        mainPanel.add(listScrollPane, BorderLayout.WEST)
        mainPanel.add(textScrollPane, BorderLayout.CENTER)

        frame.add(mainPanel)
        frame.setVisible(true)
      }
    })
  }
}

HarryPotterPart3App.main(Array())